Dim TbName As String = eForm.Name & "_table1" '定义表名
Dim hangshu As Integer = Tables(TbName).Rows.Count-1 '判断行数是否为空
If hangshu < 0 Then
Messagebox.show("图片为空,不能下载!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return ""
End If
'获取图片
Dim r As Row = Tables(TbName).Current
If r IsNot Nothing Then
Dim tpdz As String = r("图片地址")
Dim wj As String = r("审批编号") & ".png"
Network.DownloadFile(tpdz,"c:\data\temp.png","","",True,"1000",True)
Dim ftp As New FTPClient
ftp.host=vars("FTP_ip地址")
ftp.Account =vars("FTP_账号")
ftp.password =vars("FTP_密码")
ftp.Port= vars("FTP_端口")
ftp.RootDir = "\图片文件\" & Format(r("申请日期"),"yyyy") '设置根目录
'创建目录
If ftp.DirExists(ftp.RootDir) = False Then
ftp.MakeDir(ftp.RootDir)
End If
Dim sc As String = "ftp://" & ftp.Account & ":" & ftp.password & "@" & ftp.host & wj
ftp.ChangeDir("\图片文件") '进入UpLoadFile
Dim fp As String = "\图片文件"
Dim ftpName As String = fp & "\" & Format(r("申请日期"),"yyyy") & wj '保存路径
ftp.Upload("c:\data\temp.png",ftpName) '上传
r("图片名称") = wj
r.Save
' Network.UploadFile("c:\data\temp.png", sc)
End If
已解决
[此贴子已经被作者于2019/2/3 10:47:48编辑过]