参考代码
Dim dlg As new OpenFileDialog
dlg.MultiSelect = True
If dlg.ShowDialog = DialogResult.OK Then
Dim ftp1 As New FtpClient
ftp1.Host="127.0.0.1"
ftp1.Account = "test"
ftp1.Password = "test"
ftp1.UTF8 = True
For Each f As String In dlg.FileNames
Dim r As New System.Text.RegularExpressions.Regex("[0-9]*\.{1}")
Dim ary() As String = r.Split(FileSys.GetName(f))
Dim path As String = ary(0)
If ftp1.DirExists(path) = False Then ftp1.MakeDir(path)
If ftp1.Upload(f, "/" & path & "/" & filesys.GetName(f)) = True Then
output.show("上传:" & filesys.GetName(f) & " 成功")
Else
output.show("上传:" & filesys.GetName(f) & " 失败")
End If
Next
ftp1.Close
End If