老师好,下面代码为什么会在水电气抄表图片文件夹外都复制一张图片。
If Tables("水电气数据记录").Current Is Nothing Then
Return
End If
Dim dr As DataRow = Tables("水电气数据记录").Current.DataRow
Dim dlg As New OpenFileDialog
dlg.Filter = "图形文件|*.bmp;*.jpg;*.gif;*.png"
If dlg.ShowDialog = DialogResult.OK Then
dr.SQLInsertFile("总表",dlg.FileName) '插入文件
Dim pic As WinForm.PictureBox = e.Form.Controls("BBB1")
pic.Image = GetImage(dlg.FileName)
FileSys.CopyFile(dlg.FileName, "H:\能源管理\Attachments\图片管理\水电气抄表图片\" & FileSys.GetName(dlg.fileName),True)
Tables("电气数据记录").Current("总表名称") = FileSys.GetName(dlg.fileName)
End If