Dim ftp1 As New FtpClient
ftp1.Host="127.0.0.1"
ftp1.Account = "test"
ftp1.Password = "test"
ftp1.UTF8 = True
Dim dlg As new OpenFileDialog
dlg.MultiSelect = True
If dlg.ShowDialog = DialogResult.OK Then
For Each f As String In dlg.FileNames
Dim finfo As New FileInfo(f)
If ftp1.Upload(f,"/" & finfo.Name.Replace(finfo.Extension, Format(Date.Now, "yyyyMMddHHmmss") & finfo.Extension)) = True Then
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Next
End If
ftp1.Close
[此贴子已经被作者于2015/6/18 16:31:54编辑过]