先是出现正在连接,然后是“无法连接到服务器”或“与主机通讯时出现错误”。
这是哪里有问题,最好帮忙改正并写出程序解释。
另外用这个是否能正常工作,最好能有改正完善的地方,谢谢谢谢!Private Sub Command1_Click()
Inet1.url = "ftp://username:password@hostname/document"
Inet1.Protocol = 2 - icFTP
Inet1.RemoteHost = "http://127.0.0.1"
Inet1.RemotePort = 21
Inet1.UserName = "Administrator"
Inet1.Password = 5555
'执行文件传输:
Inet1.Execute "ftp://username:password@hostname PUT" & local_filename & "UPLOAD1.TXT" right1 = Inet1.StillExecuting
Do While right1
right1 = Inet1.StillExecuting
DoEvents
LoopEnd Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Select Case State
Case 1
Text1.Text = "正在查询所指定的主机的IP地址"
Case 2
Text1.Text = "成功地找到所指定的主机的IP地址"
Case 3
Text1.Text = "正在与主机连接"
Case 4
Text1.Text = "已与主机连接成功"
Case 5
Text1.Text = "正在向主机发送请求"
Case 6
Text1.Text = "发送请求已成功"
Case 7
Text1.Text = "在接收主机的响应"
Case 8
Text1.Text = "成功地接收到主机的响应"
'Inet1.Execute "", "PUT d:\1.txt 1.txt"
'ri = Inet1.StillExecuting
'Do While ri
'ri = Inet1.StillExecuting
'DoEvents
'Loop
Case 9
Text1.Text = "正在解除与主机的连接"
Case 10
Text1.Text = "已成功地与主机解除了连接"
Case 11
Text1.Text = "与主机通讯时出现了错误"
Case 12
Text1.Text = "请求已经完成,并且所有数据均已接收到"
End Select
End Sub
这是哪里有问题,最好帮忙改正并写出程序解释。
另外用这个是否能正常工作,最好能有改正完善的地方,谢谢谢谢!Private Sub Command1_Click()
Inet1.url = "ftp://username:password@hostname/document"
Inet1.Protocol = 2 - icFTP
Inet1.RemoteHost = "http://127.0.0.1"
Inet1.RemotePort = 21
Inet1.UserName = "Administrator"
Inet1.Password = 5555
'执行文件传输:
Inet1.Execute "ftp://username:password@hostname PUT" & local_filename & "UPLOAD1.TXT" right1 = Inet1.StillExecuting
Do While right1
right1 = Inet1.StillExecuting
DoEvents
LoopEnd Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Select Case State
Case 1
Text1.Text = "正在查询所指定的主机的IP地址"
Case 2
Text1.Text = "成功地找到所指定的主机的IP地址"
Case 3
Text1.Text = "正在与主机连接"
Case 4
Text1.Text = "已与主机连接成功"
Case 5
Text1.Text = "正在向主机发送请求"
Case 6
Text1.Text = "发送请求已成功"
Case 7
Text1.Text = "在接收主机的响应"
Case 8
Text1.Text = "成功地接收到主机的响应"
'Inet1.Execute "", "PUT d:\1.txt 1.txt"
'ri = Inet1.StillExecuting
'Do While ri
'ri = Inet1.StillExecuting
'DoEvents
'Loop
Case 9
Text1.Text = "正在解除与主机的连接"
Case 10
Text1.Text = "已成功地与主机解除了连接"
Case 11
Text1.Text = "与主机通讯时出现了错误"
Case 12
Text1.Text = "请求已经完成,并且所有数据均已接收到"
End Select
End Sub
解决方案 »
- 关于VB打包问题,一直找不到原因所在,请各路高手指点
- 如何用VB做防盗链软件?
- 如何实现如下形式?? 在线等,高手请进
- DAO编程初级问题,请指教!急
- 怎么把查找中的内容用datagrid显示出来!小弟在线!!
- 在MIDFORM中如何显示ani的鼠标样式?(在线等待,马上结贴!)
- 如何用VB语言来实现CRC校验函数? 朋友会的话,请回复好么?谢谢!!!
- 請教:VB如何實現報表的打印預覽?
- 在VB中如何实现将一个窗体,在没有下一个事件发生前,永远浮在其他窗体上面,其他应用程序也不能运行.谢谢!!!!
- 高分征解!Active Report问题:如何根据查询自动向报表中添加字段
- vb6.0 treeview 节点文本太长,能够设置自动换行吗?
- 求鼠标钩子获取类似于ole中 Data.Files()的信息
t = Timer
Do While Inet1.StillExecuting And Not (Timer - t > 10)
On Error Resume Next
If t > Timer Then t = t - 86400
DoEvents
Loop
Inet1.Execute , "MKDIR Image/" & UserName
t = Timer
Do While Inet1.StillExecuting And Not (Timer - t > 10)
On Error Resume Next
If t > Timer Then t = t - 86400
DoEvents
Loop
Inet1.Execute , "PUT " & App.Path & "/1.JPG Photos/1.JPG"
t = Timer
Do While Inet1.StillExecuting And Not (Timer - t > 10)
On Error Resume Next
If t > Timer Then t = t - 86400
DoEvents
Loop Inet1.Cancel
Dim t As Double Inet1.url = "ftp://xxx.xxx.xxx.xxx"
Inet1.Protocol = icFTP
Inet1.RemoteHost = "xxx.xxx.xx.xxx"
Inet1.RemotePort = "21"
Inet1.UserName = "xxxxxx"
Inet1.Password = "xxxxxx" Inet1.Execute , "MKDIR Image"
t = Timer
Do While Inet1.StillExecuting And Not (Timer - t > 10)
On Error Resume Next
If t > Timer Then t = t - 86400
DoEvents
Loop
Inet1.Execute , "MKDIR Image/" & UserName
t = Timer
Do While Inet1.StillExecuting And Not (Timer - t > 10)
On Error Resume Next
If t > Timer Then t = t - 86400
DoEvents
Loop
Inet1.Execute , "PUT " & FilePathName & " Image/" & UserName & "/" & FileName & "d.jpg"
'MsgBox FilePathName & " Image/" & UserName & "/" & FileName & "d.jpg"
t = Timer
Do While Inet1.StillExecuting And Not (Timer - t > 10)
On Error Resume Next
If t > Timer Then t = t - 86400
DoEvents
Loop Inet1.CancelEnd Sub'Private Sub Command1_Click()
'Inet1.Protocol = icFTP
' Inet1.URL = "ftp://127.0.0.1/"
' Inet1.RemotePort = 21
' Inet1.UserName = "Administrator"
' Inet1.Password = "5555"
' Inet1.OpenURL
'End SubPrivate Sub Inet1_StateChanged(ByVal State As Integer)
Select Case State
Case 1
Text1.Text = "正在查询所指定的主机的IP地址"
Case 2
Text1.Text = "成功地找到所指定的主机的IP地址"
Case 3
Text1.Text = "正在与主机连接"
Case 4
Text1.Text = "已与主机连接成功"
Case 5
Text1.Text = "正在向主机发送请求"
Case 6
Text1.Text = "发送请求已成功"
Case 7
Text1.Text = "在接收主机的响应"
Case 8
Text1.Text = "成功地接收到主机的响应"
' Inet1.Execute "", "PUT d:\1.txt 1.txt"
'ri = Inet1.StillExecuting
'Do While ri
'ri = Inet1.StillExecuting
'DoEvents
'Loop
Case 9
Text1.Text = "正在解除与主机的连接"
Case 10
Text1.Text = "已成功地与主机解除了连接"
Case 11
Text1.Text = "与主机通讯时出现了错误"
Case 12
Text1.Text = "请求已经完成,并且所有数据均已接收到"
End Select
End Sub