VB6.0 INET控件实现FTP上传文件
各位大虾:
Inet1.Protocol = icFTP
Inet1.URL = "ftp://shenying-china.oicp.net"
Inet1.RemotePort = 21
Inet1.UserName = "shenying"
Inet1.Password = "11111111"
Inet1.Execute , "PUT" & "d:/longzaitian.txt" & " " & "/longzaitian.txt"
right1 = Inet1.StillExecuting
Do While right1
right1 = Inet1.StillExecuting
DoEvents
Loop
Inet1.Execute , "close"
Inet1.Execute , "quit"
Option Explicit
Private Sub Inet1_StateChanged(ByVal State As Integer)
If State = icResponseCompleted Then
'处理语句
End If
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Debug.Print State
If State = icError Then
Debug.Print "ErrorCode: " & Inet1.ResponseCode & " : " & Inet1.ResponseInfo
End Select
End Sub
'这样试试
Inet1.Execute Inet1.URL, " PUT d:/longzaitian.txt" & " " & "/longzaitian.txt"