当前位置:编程学习 > VB >>

VB ftp下TXT文件,用BAT或INET1

要从FTP上找一个文件,如找到下载到本地,VB调用BAT文件可以联到FTP上,在我的电脑里有个FTP的共公盘Q,但不知道用什么样的VB 命令可以COPY 文件到本地,用INET1却提示:TIME OUT35754 无法联到FTP,文件代码如下
Private Sub Command1_Click()
  With Inet1
   
     .URL = "ftp://1234:linghuchong@10.169.12.64"
     .UserName = "1234"
     .Password = "linghuchong"
     .Protocol = icFTP
   '  Inet1.RemotePort = "21"
     .Execute "ftp://1234:linghuchong@10.169.12.64", "get" & strInspectPanelId & ".txt c:\" & strInspectPanelId & ".txt"
     
   End With
  'Inet1.Execute   url,   StrMsg
    
      
End Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
  Select Case State
    Case 1
          Text1.Text = "is   looking"
  Case 2
          Text1.Text = "success   finding   "
  Case 3
      Text1.Text = "is   connecting"
  Case 4
      Text1.Text = "success   connected"
  Case 5
      Text1.Text = "is   sending   request"
  Case 6
      Text1.Text = "sucess   sending"
  Case 7
      Text1.Text = "is   receiving"
  Case 8
      Text1.Text = "success   receive"
  Case 9
      Text1.Text = "is   disconnecting"
  Case 10
      Text1.Text = "success   disconnect"
  Case 11
      Text1.Text = "is   error"
  Case 12     'icResponseCompleted
      Text1.Text = "success   receive   data"
      bDowning = False
  End Select
  End Sub
调试时,总在.EXECUTE,那停就无法联机 我手机13661857035\13780011105\座机0574-86865999-13404/leiyoujied@163.com,大家帮下, --------------------编程问答-------------------- 顶起来,关注 --------------------编程问答-------------------- 具体可参考我博客中的《使用API进行FTP文件上传和下载》一文。 --------------------编程问答-------------------- up~~~~~~~~~~~~~~ --------------------编程问答-------------------- 建议楼主看看UserControl.AsyncRead方法,该方法用来进行FTP下载文件最好不过了,而且支持异步
写个自定义控件就OK了
补充:VB ,  基础类
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,