用Vb怎么开发下载和上传ftp文件(在线等) 我想上传和下载ftp的文件,我想做多线程而且我希望速度要快,请各位高手指点和告诉我一声 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 '可以利用Inet控件'''首先在部件中添加'microsoft internet transfer control 6.0Private Sub 上传_Click() Inet1.URL = IP.Text ' "ftp://61.129.102.38/" Inet1.Protocol = 2 Inet1.UserName = USER.Text ' "username" Inet1.Password = ID.Text ' "password" Inet1.Execute , "PUT " & "c:11.jpg" & " pathname\22.jpg" Do While Inet1.StillExecuting DoEvents Loop MsgBox "上传完毕!", vbInformation, "提示"End SubPrivate Sub 下载_Click() Inet1.URL = IP.Text ' "ftp://61.129.102.38/" Inet1.Protocol = 2 Inet1.UserName = USER.Text ' "username" Inet1.Password = ID.Text ' "password" Inet1.Execute , "GET pathname\111.jpg D:\111.jpg" Do While Inet1.StillExecuting DoEvents Loop MsgBox "下载完毕!", vbInformation, "提示" '或者直接用下面这条语句 ‘Inet1.Execute "ftp://ftp.microsoft.com/", "GET /PSS/Tools/ComPlus/WinResourceMgr/winrmbin.zip D:\111111.zip"End Sub 最好不使用FTP命令上传文件,因为比较麻烦。你需要先建立一个文本文件,如test.txt,写入必要的FTP命令,然后建立一个.bat文件,写入命令: FTP < test.txt 再使用 Shell yourftp.bat 调用命令上传文件。这个方法的另一个缺点是不知道上传的结果如何。 你最好使用VB6的Microsoft Internet Transfer 控件,使用下面的语句就可以了: Inet1.URL = "FTP://ftp.myCompany.com" Inet1.Password = "I(3Lei#4" Inet1.UserName = "Jonne Smythe" Inet1.OpenURL Inet1.Execute , "SEND C:\MyDocuments\Send.txt SentDocs\Sent.txt" Inet1.Execute , "QUIT" up,用个FTP控件解决!这种到了到了泛滥的地步! VB6 数组传值与DLL问题 初学者请教。。多谢各位的回答 难题!!!吐血求救!!!跪求代码。 看看这个问题,怎么解决了?帮帮忙? 这段代码正确吗? 求助:怎样得到字符串宽度 谁有VB资产评估系统的源码,高分求救 请问大虾:如何在VB中进行可见即可得的打印预览? 文件合并问题 请问怎样将图片存于数据库中? activereport好用,但有一个麻烦,不知如何解决? 多用户访问的并发控制问题(在线等候)
Private Sub 上传_Click()
Inet1.URL = IP.Text ' "ftp://61.129.102.38/"
Inet1.Protocol = 2
Inet1.UserName = USER.Text ' "username"
Inet1.Password = ID.Text ' "password"
Inet1.Execute , "PUT " & "c:11.jpg" & " pathname\22.jpg"
Do While Inet1.StillExecuting
DoEvents
Loop
MsgBox "上传完毕!", vbInformation, "提示"
End SubPrivate Sub 下载_Click()
Inet1.URL = IP.Text ' "ftp://61.129.102.38/"
Inet1.Protocol = 2
Inet1.UserName = USER.Text ' "username"
Inet1.Password = ID.Text ' "password"
Inet1.Execute , "GET pathname\111.jpg D:\111.jpg"
Do While Inet1.StillExecuting
DoEvents
Loop
MsgBox "下载完毕!", vbInformation, "提示"
'或者直接用下面这条语句
‘Inet1.Execute "ftp://ftp.microsoft.com/", "GET /PSS/Tools/ComPlus/WinResourceMgr/winrmbin.zip D:\111111.zip"
End Sub
FTP < test.txt
再使用
Shell yourftp.bat
调用命令上传文件。这个方法的另一个缺点是不知道上传的结果如何。
你最好使用VB6的Microsoft Internet Transfer 控件,使用下面的语句就可以了:
Inet1.URL = "FTP://ftp.myCompany.com"
Inet1.Password = "I(3Lei#4"
Inet1.UserName = "Jonne Smythe"
Inet1.OpenURL
Inet1.Execute , "SEND C:\MyDocuments\Send.txt SentDocs\Sent.txt"
Inet1.Execute , "QUIT"