我的打开文件的代码是按实例修改得到的;除了Excel文件外,其他文件均正常,对Excel文件无论本地是否存在都会重新下载,不知是何原因?代码如下:
If Tables("工程预算.送审预算").Current Is Nothing Then
Return
End If
Dim dr As DataRow = Tables("工程预算.送审预算").Current.DataRow
Dim fl As String = ProjectPath & "\temp\" & dr("文件名")
If FileSys.FileExists(fl) AndAlso CRCCheckFile(fl) = dr.SQLGetValue("CRC值") Then '如果本地存在同名文件且CRC校验值相同
'则直接使用本地文件
Else '否则从数据库提取文件
MessageBox.Show("1")
If dr.SQLLoadFile("文件",fl) = False Then '如果提取文件失败
' Messagebox.Show("预算文件提取失败,可能并不存在预算文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
End If
End If
Dim Proc As New Process '打开文件
Proc.File = fl
Proc.Start()