Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ftp

vb6

inet

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


1 Answers

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


Ok, i got it. We'll use (DIR), the FTP command to retrieve the directories within 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 the UsrName, PassWord and URL in place.

like image 165
Tomalak Avatar answered Dec 08 '25 06:12

Tomalak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!