使用inet进行FTP传输(转)


'大文件传输不太适合
'添加intl控件

Private Sub Command1_Click()
Inet1.Protocol = icFTP
Inet1.RemoteHost = "60.***.***.***" '服务器地址
Inet1.RemotePort = 21 'FTP端口
Inet1.UserName = "username" '用户名
Inet1.Password = "userpass" '密码
Print "开始"
'下载文件:
Inet1.Execute "", "GET /adfile/1.txt d:\下载的.txt"
ri = Inet1.StillExecuting
Do While ri
ri = Inet1.StillExecuting
DoEvents
Loop
Print "结束"
End Sub

Private Sub Command2_Click()

Inet1.Protocol = icFTP
Inet1.RemoteHost = "60.***.***.***" '服务器地址
Inet1.RemotePort = 21 'FTP端口
Inet1.UserName = "username" '用户名
Inet1.Password = "userpass" '密码

Print "开始"
'上传文件:
Inet1.Execute "", "PUT d:\1.txt /adfile/1.txt"
ri = Inet1.StillExecuting
Do While ri
ri = Inet1.StillExecuting
DoEvents
Loop
Print "完成"
End Sub

 

posted @ 2008-06-21 00:12  jetz  阅读(978)  评论(0编辑  收藏  举报