Original Post
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