How to return all directories from an FTP site to VB6 Listbox using Inet.OCX?

I have a VB6 project, it connects perfectly to the remote ftp server (i.e. ftp://ftp.microsoft.com ), I want to list all the directories names on the ftp server in the ListBox using only Inet1.ocx. How can i do this?

+3
source share
2 answers

Taken from @AhmedEbied's comment on my answer below.


OK I understood. We will use the (DIR) FTP command to retrieve directories on the FTP server. Using (DIR) COMMAND Inet1.Execute, ("DIR")

' CommandButton 
Private Sub Get_Dir_Click() 
  Dim Data as String, Data1 as String 

  ' Get List of all files 
  Do Data1 = Inet1.GetChunk(1024, icString) 
    Data = Data & Data1 
  Loop While Len(Data1) <> 0 

  Text4.Text = Data 
End Sub 

Of course I had UsrName, PassWordand URL.

+2
source

ActiveX FTP, : Chilkat FTP. , , FTP, FTP2. .

, .

+1

All Articles