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("第十列")
Messagebox.Show("请将源文件目录拷贝到C盘根目录下!","提示")
If FileSys.DirectoryExists("c:/A/"& r("第四列") ) Then '如果指定的文件目录存在
If ftp1.DirExists(l) Then
Messagebox.Show("服务器文件目录已经存在!","提示")
If FileSys.FileExists(f) Then
If ftp1.Upload(f,sf) = True Then
Messagebox.show("" &r("第四列")&" 1的上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("" &r("第四列")&" 1的上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
Messagebox.show("没有找到 " &r("第四列")&" 1的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
If FileSys.FileExists(f1) Then
If ftp1.Upload(f1,sf1) = True Then
Messagebox.show("" &r("第四列")&" 2的上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("" &r("第四列")&" 2的上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
Messagebox.show("没有找到 " &r("第四列")&" 2的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
If FileSys.FileExists(f2) Then
If ftp1.Upload(f2,sf2) = True Then
Messagebox.show("" &r("第四列")&" 3的银行卡图片上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("" &r("第四列")&" 3的图片上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
Messagebox.show("没有找到 " &r("第四列")&" 3的图片!","提示",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 FileSys.FileExists(f) Then
If ftp1.Upload(f,sf) = True Then
Messagebox.show("" &r("第四列")&" 1的上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("" &r("第四列")&" 1的上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
Messagebox.show("没有找到 " &r("第四列")&" 1的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
If FileSys.FileExists(f1) Then
If ftp1.Upload(f1,sf1) = True Then
Messagebox.show("" &r("第四列")&" 2的上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("" &r("第四列")&" 2的上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
Messagebox.show("没有找到 " &r("第四列")&" 2的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
If FileSys.FileExists(f2) Then
If ftp1.Upload(f2,sf2) = True Then
Messagebox.show("" &r("第四列")&" 3的图片上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("" &r("第四列")&" 3的图片上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
Messagebox.show("没有找到 " &r("第四列")&" 3的图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
If DataTables("表A").HasChanges Then
DataTables("表A").Save
End If
Else
Messagebox.Show("创建目录失败,请联系管理员!")
End If
End If
Else
Messagebox.Show("源文件目录不存在!","提示")
End If
这样应该是比较完美了,但是就是不是马上显示图片这是为什么?