For Each File As String In FileSys.GetFiles("D:\TEMP\")
With CurrentTable
Dim r As Integer
r = .Find(FILE, 0, 0, False, True, False)
If r = - 1 AndAlso file.Length=16 Then '如果找到符合条件的行
Dim r1 As Row = CurrentTable.AddNew()
r1("文件名")=file
r1("获取时间")=Date.Now()
r1("条形码")=file.SubString(0,12)
FileSys.CopyFile("D:\TEMP\", ProjectPath & "pic\" & file,True)
r1("图片") = ProjectPath & "pic\" & file
Dim xuhao As String=file.SubString(6,2)
Dim dr As DataRow
dr = DataTables("基础资料").Find("企业编码 = '" & xuhao & "'")
If dr IsNot Nothing '如果找到
r1("企业名称")=dr("企业名称")
End If
End If
End With
Next
DataTables("主表").Save()
[此贴子已经被作者于2021/2/9 20:04:52编辑过]