Dim dlg As new OpenFileDialog
If dlg.ShowDialog = DialogResult.OK Then
Dim ftp1 As New FtpClient
ftp1.Host="192.168.1.18"
ftp1.Port = 21
ftp1.Account = "cgjftp"
ftp1.Password = "Xj671766"
'ftp1.Changedir("\员工相片")
Dim r As Row = Tables("员工档案").Current
If r IsNot Nothing Then
Dim name As String = r("身份证号码") & FileSys.GetName(dlg.FileName).Split(".")(1)
If ftp1.Upload(dlg.FileName, "\人事管理\员工相片\" & name) = True Then
r("照片") &= IIF(r.IsNull("照片"), "", vbcrlf) & "/" & name
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If
ftp1.close
End If