Dim ftp1 As New FtpClient
ftp1.Host="021.66ip.net"
ftp1.Account = "byftpuser"
ftp1.Password = "654321"
Dim r As Row = Tables("表A").current
Dim l As String = "/A/"& r("第四列")
Dim f As String = "c:"& r("第八列")
Dim f1 As String = "c:"& r("第九列")
Dim f2 As String = "c:"& r("第十列")
Dim sf As String = r("第八列")
Dim sf1 As String = r("第九列")
Dim sf2 As String = r("第十列")
If FileSys.DirectoryExists("c:/A/"& r("第四列") ) Then '如果指定的文件目录存在
If ftp1.DirExists(l) Then
Messagebox.Show("FTP文件目录已经存在!","提示")
If ftp1.Upload(f,sf) = True And ftp1.Upload(f1,sf1) = True And ftp1.Upload(f2,sf2) = True Then
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
If DataTables("表A").HasChanges Then
DataTables("表A").Save
End If
Else
If ftp1.MakeDir(l) Then
Messagebox.Show("创建目录成功!")
If ftp1.Upload(f,sf) = True And ftp1.Upload(f1,sf1) = True And ftp1.Upload(f2,sf2) = True Then
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
If DataTables("表A").HasChanges Then
DataTables("表A").Save
End If
End If
End If
Else
Messagebox.Show("源文件目录不存在!","提示")
End If
这个应该没问题了