一、问题描述:
使用VB Inet控件,将指定文件上传至远程ftp服务器,在有的电脑上传成功,有的电脑一直卡在正在上传状态,直至超时。代码如下:
Private Sub Command1_Click()
Dim FileName, putfile As String
Dim mulu As String '上传服务器的文件夹名称
'设置FTP的地址、协议类型、用户名、密码
Inet1.URL = "ftp://172.19.101.41" 'FTP的地址
Inet1.Protocol = icFTP
Inet1.RemotePort = 21 'FTP端口
Inet1.RemoteHost = "172.19.101.41"
.
'协议类型
Inet1.UserName = "admin" 'FTP的用户名
Inet1.Password = "123456" 'FTP的密码
Dim Source As String
Source = "c:\123.log"
filesize = FileLen(Source)
mulu= "testDir"
Inet1.RequestTimeout = 300
Inet1.Execute , "put " & Source & " gongxiang\" & mulu & "\123.log"
Do While Inet1.StillExecuting
DoEvents
Loop
End Sub