下面是程序,请高手帮忙看看哪里有问题了?
Private Sub Command1_Click()
      Dim StrMsg     As String
      Dim isbusy     As Boolean
         
     ' strmsg=   Inet1.URL, "put " & App.Path & "/1.JPG Photos/1.JPG"
         
      Inet1.URL = "ftp://xxx.xxx.xxx.xxx"
  Inet1.Protocol = icFTP
  Inet1.RemoteHost = "xxx.xxx.xxx.xxx"
  Inet1.RemotePort = "21"
  Inet1.UserName = "xxx"
  Inet1.Password = "xxx"
         
      StrMsg = "c:\1.JPG \1.JPG"
      Inet1.Execute , StrMsg
         
      Do While Inet1.StillExecuting
            DoEvents
      Loop
  End Sub
     
  Private Sub Inet1_StateChanged(ByVal State As Integer)
  '状态信息提供了中英文两种
  Select Case State
    Case 1
                Text1.Text = "is     looking"
                Text1.Text = "正在查询所指定的主机的     IP     地址"
  Case 2
                Text1.Text = "success     finding     "
                Text1.Text = "成功地找到所指定的主机的     IP     地址"
  Case 3
        Text1.Text = "is     connecting"
        Text1.Text = "正在与主机连接"
  Case 4
        Text1.Text = "success     connected"
        Text1.Text = "已与主机连接成功"
  Case 5
        Text1.Text = "is     sending     request"
        Text1.Text = "正在向主机发送请求"
  Case 6
        Text1.Text = "sucess     sending"
        Text1.Text = "发送请求已成功"
  Case 7
        Text1.Text = "is     receiving"
        Text1.Text = "在接收主机的响应"
  Case 8
        Text1.Text = "success     receive"
        Text1.Text = "成功地接收到主机的响应"
  Case 9
        Text1.Text = "is     disconnecting"
        Text1.Text = "正在解除与主机的连接"
  Case 10
        Text1.Text = "success     disconnect"
        Text1.Text = "已成功地与主机解除了连接"
  Case 11
        Text1.Text = "is     error"
        Text1.Text = "与主机通讯时出现了错误"
  Case 12         'icResponseCompleted
        Text1.Text = "success     receive     data"
        Text1.Text = "请求已经完成,并且所有数据均已接收到"
        Select Case OperationStyle
        Case 2
                        filesize = Inet1.GetChunk(1024, 0)
                                MsgBox CStr(filesize)
        Case 3
           
        Case 4
           
        Case Else
        End Select
  End Select
  End Sub

解决方案 »

  1.   

    StrMsg = "put " & App.Path & "/1.JPG Photos/1.JPG"
      

  2.   

    改成这个也一样:StrMsg = "put " & App.Path & "/1.JPG  1.JPG"可以排除远程目录不存在而出现这问题。
      

  3.   

    App.Path 中间不能有空格。
      

  4.   

      StrMsg = "c:\1.JPG \1.JPG"
    这是什么?笔误?
      

  5.   

    Inet1.Execute Inet1.URL, "put " & App.Path & "/1.JPG 远程主机文件路径名称"
    远程主机文件路径名称的格式要用远程主机的语法