我的程序如下,
Private Sub Command2_Click()
With Inet1
'.URL =ftp://gying:gy1234@wenxian
.AccessType = icDirect
End With
Inet1.Execute "ftp:/gying:[email protected]", "put e:\gy\photos\517.jpg gy.jpg"
right1 = Inet1.StillExecuting
Do While right1
right1 = Inet1.StillExecuting
DoEvents
Loop
End
End Sub
运行后,既没有错误提示,服务器上也没有出现所上传的文件。是怎麽回事?服务器上开了FTP服务,用cuteftp可以上传文件。

解决方案 »

  1.   

    还得指定端口和协议吧
    Inet1.Protocol = icFTP
    Inet1.RemotePort = 21
      

  2.   

    程序改为如下,还是连接不上,一运行就出错,显示“不能连接到远程主机”,怎麽办?
    Inet1.Protocol = icFTP
    Inet1.AccessType = icUseDefault
    Inet1.UserName = "gying"
    Inet1.Password = "gy1234"
    Inet1.RequestTimeout = 20
    Inet1.URL = "ftp://203.212.9.56"
    Inet1.Document = "e:\gy\photos\517.jpg"
    Inet1.RemotePort = 21Inet1.Execute Inet1.URL, "put e:\gy\photos\517.jpg gy.jpg"
      

  3.   

    Inet1.Protocol  =  icFTP  
    Inet1.AccessType  =  icUseDefault  
    Inet1.Username  =  ftpUsername  
    Inet1.Password  =  ftpPassword  
    Inet1.RequestTimeout  =  20  
    Inet1.URL  =  ftpURL  
     
    Private  Sub  sendFile(localFile  As  String,  remoteFile  As  String)  
         Inet1.Execute  Inet1.URL,  "send  """  &  localFile  &  """"  &  "  "  &  """"  &  remoteFile  &  """"  
           Do  
                   DoEvents  
           Loop  While  Inet1.StillExecuting  =  True  
     
    End  Sub