VB如何上传文件到服务器 ?非FTP方式!而且不是VB.NET,不是ASP 而是窗体界面!最好有一段示例!谢谢!VB6.0
2个回答
展开全部
Private Sub Command1_Click()
'下载文件:
Inet1.Execute "", "GET firewall.rsc 文件路径"
ri = Inet1.StillExecuting
Do While ri
ri = Inet1.StillExecuting
DoEvents
Loop
End Sub
Private Sub Command2_Click()
'上传文件:
Inet1.Execute "", "PUT d:\11.xls 11.xls"
ri = Inet1.StillExecuting
Do While ri
ri = Inet1.StillExecuting
DoEvents
Loop
End Sub
Private Sub Form_Load()
Inet1.Protocol = icFTP
Inet1.RemoteHost = "192.168.1.1" '服务器地址
Inet1.RemotePort = 21 'FTP端口
Inet1.UserName = "" '用户名
Inet1.Password = ""
End Sub
这个我测试通过
'下载文件:
Inet1.Execute "", "GET firewall.rsc 文件路径"
ri = Inet1.StillExecuting
Do While ri
ri = Inet1.StillExecuting
DoEvents
Loop
End Sub
Private Sub Command2_Click()
'上传文件:
Inet1.Execute "", "PUT d:\11.xls 11.xls"
ri = Inet1.StillExecuting
Do While ri
ri = Inet1.StillExecuting
DoEvents
Loop
End Sub
Private Sub Form_Load()
Inet1.Protocol = icFTP
Inet1.RemoteHost = "192.168.1.1" '服务器地址
Inet1.RemotePort = 21 'FTP端口
Inet1.UserName = "" '用户名
Inet1.Password = ""
End Sub
这个我测试通过
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询