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("\员工相片")
If ftp1.Upload(dlg.FileName, "/" & FileSys.GetName(dlg.FileName)) = True Then
Tables("员工档案").Current("照片") &= IIF(Tables("员工档案").Current.IsNull("照片"), "", vbcrlf) & "/" & FileSys.GetName(dlg.FileName)
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
ftp1.close
End If
求代码
修改成上传的图片自动用身份证号命名并按指定路径保存
FTP路径:192.168.1.18/人事管理/员工相片/
表名:员工档案 列名:照片