If Tables("充值凭证表").current("充值凭证") Is Nothing Then
Dim wjjmc As String
Dim t As Table = Tables("充值凭证表")
wjjmc =Format(T.Current("充值日期"),"yyy年MM月dd日") & "【" & T.Current("起始号") & "至" & T.Current("终止号") & "】"
Dim dlg As New FolderBrowserDialog
Dim czkh As DataRow
Dim shID As String = e.Form.Controls("czpzIDTextBox").value
Dim dr1 As DataRow = DataTables("充值凭证表").Find("充值凭证ID= '" & shID & "'" )
Dim str As String = dr1("充值凭证原始名称")
Dim lst As List(of String)
If dr1.isnull("充值凭证") Then
lst = new List(of String)
Else
lst =dr1.Lines("充值凭证")
End If
If FileSys.DirectoryExists(ProjectPath & "照片\充值凭证截图\" & wjjmc & "\" ) Then '如果目录C:\MyFolder存在
For Each file As String In FileSys.GetFiles(ProjectPath & "照片\充值凭证截图\" & wjjmc & "\" )
Dim name As String = FileSys.GetName(file)
If name.Contains(str) AndAlso lst.contains(name) = False Then
lst.add(name)
End If
Next
dr1.lines("充值凭证") = lst
DataTables("充值凭证表").Save
DataTables("充值凭证表").DataCols("充值凭证").DefaultFolder =ProjectPath & "照片\充值凭证截图\" & wjjmc & "\"
End If
End If
启动后只能加载一条图片,其他有图片也不显示