我想用inet写一个向ftp服务器上传文件的程序,能不能提供一些例子。

sxtl 2004-08-02 02:43:00
我想用inet写一个向ftp服务器上传文件的程序,能不能提供一些例子。
...全文
295 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
online 2004-08-02
  • 打赏
  • 举报
回复
看我的代码
sxtl 2004-08-02
  • 打赏
  • 举报
回复
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"
大家帮我看看这段代码吧,总无法正常运行。给出连接超时提示或出错。
online 2004-08-02
  • 打赏
  • 举报
回复
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
online 2004-08-02
  • 打赏
  • 举报
回复
inet1.execute ,"put c:\mc.zip /mc1.zip"

你试试
sxtl 2004-08-02
  • 打赏
  • 举报
回复
请教一下SerFilespec具体格式该如何写。
axinaiyi 2004-08-02
  • 打赏
  • 举报
回复
Inet1.Execute , "PUT " & LocFilespec & " " & SerFilespec
Do While Inet1.StillExecuting
DoEvents
If ConnectedFlag = False Then
Exit Sub
End If
Loop
这样就可以,但是不能覆盖
bluesky23 2004-08-02
  • 打赏
  • 举报
回复
同意楼上。
rainstormmaster 2004-08-02
  • 打赏
  • 举报
回复
使用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"

7,789

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧