这么就修改第一条记录呢?
Dim path = ProjectPath & "测试图片\"
Dim zpxghmc As String
Dim khmc As String
Dim dr = Tables("客户资料").Current
Dim t As Table = Tables("客户资料")
If dr Is Nothing Then '如果没找到的话
MessageBox.Show("数据库中无数据,无效操作!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
Else
zpxghmc =dr("客户姓名")
If dr.IsNull("身份证号") = False Then
zpxghmc =zpxghmc & right(dr("身份证号"),6) & "-"
Else
zpxghmc = zpxghmc & "-"
End If
For Each r As Row In Tables("客户资料").rows
khmc =r("客户姓名")
If FileSys.DirectoryExists( path & dr("客户姓名")) Then
For Each File As String In FileSys.GetFiles( path & dr("客户姓名"))
Dim name() As String = FileSys.GetName(file).split("-")
If name.length > 1
If FileSys.FileExists(path & dr("客户姓名") & "\" & zpxghmc & name(1)) = False Then
If t.Current IsNot Nothing Then
FileSys.CopyFile(file, ProjectPath & "复制到文件夹/" & zpxghmc & name(1), True)
FileSys.RenameFile(file, zpxghmc & name(1))
End If
End If
End If
Next
Else
MessageBox.Show("要修改的文件夹不存在!", "提示")
Return
End If
Next
MessageBox.Show("照片名称修改成功!", "提示")
End If
[此贴子已经被作者于2019/1/9 23:41:44编辑过]