Dim ftp1 As New FtpClient
ftp1.Host=Tables("FTPIP").Current("FTPhost")
ftp1.Account = Tables("FTPIP").Current("FTPAccount")
ftp1.Password = Tables("FTPIP").Current("FTPpassword")
Dim r As Row = Tables("员工信息_员工信息").current
Dim l As String = "/身份证/"& r("证件号码") + r("员工姓名")
msgbox(l)
Dim dlg As New FolderBrowserDialog '选择目录对话框
dlg.Description = "选择文件夹" '对话框的说明
dlg.ShowNewFolderButton = False '不显示"新建文件夹"按钮
If dlg.ShowDialog = DialogResult.Ok Then '如果单击确定
MessageBox.Show("你选择的目录是:" & dlg.SelectedPath ,"提示")
Dim f As String = dlg.SelectedPath & "\" & r("员工姓名") & "1.jpg"
Dim f1 As String = dlg.SelectedPath & "\" & r("员工姓名") & "2.jpg"
Dim sf As String = r("证件图1")
msgbox(sf) '这里弹出的值是否正确
Dim sf1 As String = r("证件图2")
msgbox(sf1)
If ftp1.DirExists(l) = False Then
If ftp1.MakeDir(l) = False Then
Messagebox.Show("创建目录失败,请联系管理员!")
Return
End If
End If
If FileSys.FileExists(f) Then
If ftp1.Upload(f,sf) = True Then
Messagebox.show("" &r("员工姓名")&" 身份证正面上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("" &r("员工姓名")&" 身份证正面上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
Messagebox.show("没有找到 " &r("员工姓名")&" 的身份证(正面)图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
If FileSys.FileExists(f1) Then
If ftp1.Upload(f1,sf1) = True Then
Messagebox.show("" &r("员工姓名")&" 身份证反面上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("" &r("员工姓名")&" 身份证反面上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
Messagebox.show("没有找到 " &r("员工姓名")&" 的身份证(反面)图片!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
If DataTables("员工信息_员工信息").HasChanges Then
DataTables("员工信息_员工信息").Save
End If
Tables("员工信息_员工信息").RaisePositionChanged()
End If