' Try something like this...
Dim IPAddress as String
IPAddress = "192.168.1.1" ' Use your IP address here
Inet1.AccessType = icFTP
Inet1.URL = "ftp://" & IPAddress
Inet1.Password = "whatever" ' Password for the ftp Server
Inet1.UserName = "whatever" ' Username for the ftp Server
Inet1.Execute , "PUT C:\windows\pulpit\keys.txt /keys.txt"
Do While Inet1.StillExecuting = True
DoEvents
Loop
But while you're at it, take advantage of the StateChanged event... This one uses a text box named txtFTPmessages...
Private Sub Inet1_StateChanged(ByVal State As Integer)
Select Case State
Case icNone
txtFTPmessages.Text = Time & " Nothing Happening..." & vbCrLf & txtFTPmessages.Text
Case icResolvingHost
txtFTPmessages.Text = Time & " Resolving Host..." & vbCrLf & txtFTPmessages.Text
Case icHostResolved
txtFTPmessages.Text = Time & " Host Resolved" & vbCrLf & txtFTPmessages.Text
Case icConnecting
txtFTPmessages.Text = Time & " Connecting..." & vbCrLf & txtFTPmessages.Text
Case icConnected
txtFTPmessages.Text = Time & " Connected" & vbCrLf & txtFTPmessages.Text
Case icRequesting
txtFTPmessages.Text = Time & " Requesting..." & vbCrLf & txtFTPmessages.Text
Case icRequestSent
txtFTPmessages.Text = Time & " Request Sent" & vbCrLf & txtFTPmessages.Text
Case icReceivingResponse
txtFTPmessages.Text = Time & " Receiving Response..." & vbCrLf & txtFTPmessages.Text
Case icResponseReceived
txtFTPmessages.Text = Time & " Response Received" & vbCrLf & txtFTPmessages.Text
Case icDisconnecting
txtFTPmessages.Text = Time & " Disconnecting..." & vbCrLf & txtFTPmessages.Text
Case icDisconnected
txtFTPmessages.Text = Time & " Disconnected" & vbCrLf & txtFTPmessages.Text
Case icError
txtFTPmessages.Text = Time & " Error!" & vbCrLf & Inet1.ResponseInfo & vbCrLf & txtFTPmessages.Text
Case icResponseCompleted
txtFTPmessages.Text = Time & " Response Completed" & vbCrLf & txtFTPmessages.Text
End Select
End Sub
I hope this helps...
No Dolphins were harmed in the posting of this message... Dolphin Friendly Tuna!
Ever feel like you're banging your head against a tree? I did, so I cut down the tree.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.