Skip to main content
gamedev.net
🔒 Locked

VB FTP

Started by Greg K 0 replies 500+ views
Original Post
Greg K
Greg K
I am trying to write a simple ftp program in VB. I am using the inet object. Public Sub console_Add(str As String) console.AddItem str console.TopIndex = console.ListCount - 1 End Sub Private Sub Form_Activate() Dim url As String FTP.Execute "ftp://ftpaddress/", "open" FTP_WaitUntilComplete FTP.Execute , "ls" Dim s As String s = FTP.GetChunk(2, icString) console_Add (s) End Sub Public Sub FTP_WaitUntilComplete() Do While FTP.StillExecuting End Sub Private Sub FTP_StateChanged(ByVal State As Integer) Rem Post server messages Select Case State Case 0: console_Add ("No state information is available") Case 1: console_Add ("Looking up the IP address for the remote server") Case 2: console_Add ("Found the IP address for the remote server") Case 3: console_Add ("Connecting to the remote server") Case 4: console_Add ("Connected to the remote server") Case 5: console_Add ("Requesting information from the remote server") Case 6: console_Add ("The request was sent successfully to the remote server") Case 7: console_Add ("Receiving a response from the remote server") Case 8: console_Add ("The response was received successfully from the remote server") Case 9: console_Add ("Disconnecting from the remote server") Case 10: console_Add ("Disconnected from the remote server") Case 11: console_Add ("An error was detected when communicating with the remote computer") Case 12: console_Add ("The request was completed; all data has been received") End Select End Sub Private Sub cmdExit_Click() FTP.Cancel End End Sub It connects to the server but just freezes. Does anyone know how to use inet properly? -Greg
Jason Zelos
Jason Zelos
I''ve not used inet, but I have XmlHTTPServer object. The default timeout is set to 5 mins, and you need to specify proxy settings or get timouts after that period.

Maybe worth a closer look as I''m guessing you are getting a long loop here:

Do
While FTP.StillExecuting


Jay

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.