Dim dlg As New FolderBrowserDialog
If dlg.ShowDialog = DialogResult.Ok Then
MessageBox.Show("你选择的目录是:" & dlg.SelectedPath,"提示")
For Each dr As DataRow In DataTables("客户档案").Select("姓名 is not null")
Dim str1 As String = dr("姓名")
Dim str2 As String = ""
If dr.isnull("身份证") = False Then
str2 = str2 & right(dr("身份证"),6)
End If
Dim str3 = "-身份证正面"
Dim str4 = "-身份证反面"
For Each file As String In FileSys.GetFiles(dlg.SelectedPath)
Dim name As String = FileSys.GetName(file)
If name.Contains(str1) AndAlso name.Contains(str2) AndAlso (name.contains(str3) OrElse name.contains(str4)) Then
Dim ls = dr.Lines("身份证照片")
If ls.contains(name) = False Then
ls.add(name)
dr.lines("身份证照片") = ls
End If
End If
Next
Next
End If