Dim ftp1 As New FtpClient
ftp1.Host="192.168.1.8"
ftp1.Port = 21
ftp1.Account = "cgftp"
ftp1.Password = "Xj671766"
Dim r As Row = Tables("项目经理").Current
If r IsNot Nothing Then
If Tables("项目经理").Current("证件图片") <> "" Then
Dim result As dialogresult= MessageBox.show("是否替换证件图片?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question)=DialogResult.Yes
If result = DialogResult.No Then
Return
End If
Else
End If
Dim dlg As New OpenFileDialog
If dlg.ShowDialog = DialogResult.OK Then
Dim name As String = r("专业") & r("证件名称") & "-" & r("姓名") & "." & FileSys.GetName(dlg.FileName).Split(".")(1) '文件名格式
If ftp1.Upload(dlg.FileName, "\证件管理\项目经理\" & name) = True Then
r("证件图片") = "\证件管理\项目经理\" & name
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If
End If
ftp1.close