Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
dlg.Filter= "图形文件|*.bmp;*.jpg;*.gif;*.png" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
MessageBox.Show("你选择的是:" & dlg.FileName,"提示") '提示用户选择的文件
End If
Dim ftp1 As New FtpClient
ftp1.Host="43.***.***.11"
ftp1.Account = "f**2644*"
ftp1.Password = "*t**571*"
Dim name As String =dlg.FileName.SubString(dlg.FileName.LastIndexOf("\")+1)
MessageBox.Show(name )
If ftp1.Upload(dlg.FileName , "\web\" & name)= True Then
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Dim wz As String= "ftp://f**2644*:Z*****6@ff**2644*n.cn\web\" & name
Messagebox.show("当前网址:"&"wz")
[此贴子已经被作者于2019/5/11 13:17:35编辑过]