以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]FTP的“上传”问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=43976)

--  作者:kolen
--  发布时间:2013/12/19 21:20:00
--  [求助]FTP的“上传”问题

 

做了一个FTP的“上传”按钮,代码如下,就是上传失败,问题出在哪里呀,请老师帮我看看。

 

Dim dlg As New OpenFileDialog
Dim flm As WinForm.FileManager = e.Form.Controls("FileManager1")

If dlg.ShowDialog = DialogResult.OK Then

 

Dim ftp1 As New FtpClient
ftp1.Host="192.168.0.39"
ftp1.Account = "xinrui"
ftp1.Password = "xinrui123"
ftp1.Port = "1444"
Dim ss As String =  "\\best\\"& FileSys.GetName(dlg.FileName)


If ftp1.Upload(dlg.FileName, ss ) = True Then
    Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
    Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If


End If

[此贴子已经被作者于2013-12-19 21:20:31编辑过]

--  作者:kolen
--  发布时间:2013/12/19 21:24:00
--  

可以了,哈哈。原来把地址中168错打成169了。图片点击可在新窗口打开查看浪费了一个晚上啊

ftp1.Host="192.168.0.39"


--  作者:有点甜
--  发布时间:2013/12/19 21:28:00
--  
 试试把\\改成/

Dim ss As String =  "/best/"& FileSys.GetName(dlg.FileName)