老师好,绝对路径改成相对路径,谢谢老师!
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("PictureBox1")
pic.Image = GetImage(dlg.FileName)
FileSys.CopyFile(dlg.FileName, "H:\项目\Attachments\管理\图片\证件照\" & FileSys.GetName(dlg.fileName),True)
Tables("通讯录").Current("证件照") = FileSys.GetName(dlg.fileName)
End If