我想用inet写一个向ftp服务器上传文件的程序,能不能提供一些例子。
我想用inet写一个向ftp服务器上传文件的程序,能不能提供一些例子。 问题点数:100、回复次数:8Top
1 楼rainstormmaster(暴风雨 v2.0)回复于 2004-08-02 15:05:18 得分 15
使用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"
Top
2 楼bluesky23(乐天_正在开发右半脑。。。^_^)回复于 2004-08-02 15:12:34 得分 0
同意楼上。Top
3 楼axinaiyi(阿信)回复于 2004-08-02 15:23:09 得分 15
Inet1.Execute , "PUT " & LocFilespec & " " & SerFilespec
Do While Inet1.StillExecuting
DoEvents
If ConnectedFlag = False Then
Exit Sub
End If
Loop
这样就可以,但是不能覆盖Top
4 楼sxtl()回复于 2004-08-02 15:38:51 得分 0
请教一下SerFilespec具体格式该如何写。Top
5 楼online(龙卷风V4.0--决战江湖(MS MVP-VB))回复于 2004-08-02 15:59:42 得分 0
inet1.execute ,"put c:\mc.zip /mc1.zip"
你试试
Top
6 楼online(龙卷风V4.0--决战江湖(MS MVP-VB))回复于 2004-08-02 16:01:26 得分 70
Private Sub Command1_Click()
Dim StrMsg As String
Dim isbusy As Boolean
Inet1.URL = "ftp://192.168.0.1/"
Inet1.Protocol = icFTP
Inet1.UserName = ""
Inet1.Password = ""
StrMsg = "Dir"
Inet1.Execute , StrMsg
end sub
Private Sub Command4_Click()
'OperationStyle = 3
Inet1.Execute , "put c:\aa.rar /mc1.zip"
'Inet1.Execute , "send c:\aa.zip"
End Sub
Top
7 楼sxtl()回复于 2004-08-02 16:38:42 得分 0
On Error GoTo errhandle
Dim StrMsg As String
Dim isbusy As Boolean
Inet1.URL = "ftp://10.1.2.130/"
Inet1.Protocol = icFTP
Inet1.UserName = ""
Inet1.Password = ""
Inet1.OpenURL
Inet1.Execute , "Put C:\ee.txt /ee.txt"
isbusy = True
Do While isbusy
isbusy = Inet1.StillExecuting
DoEvents
Loop
Inet1.Execute , "QUIT"
Exit Sub
errhandle:
MsgBox Err.Description
Inet1.Execute , "QUIT"
大家帮我看看这段代码吧,总无法正常运行。给出连接超时提示或出错。Top
8 楼online(龙卷风V4.0--决战江湖(MS MVP-VB))回复于 2004-08-02 16:51:57 得分 0
看我的代码Top




