【发布时间】:2014-01-28 16:59:38
【问题描述】:
我们有一个 Win Forms 应用程序,它使用 iTextSharp 生成 pdf,将其保存到本地目录,然后应用程序打开文件。对于一位客户(所有 XP 框和 Adobe Reader 11),它会引发以下错误
No application is associated with the specified file for this operation
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
这表明 Adobe Reader 与 pdf 扩展名没有正确关联,除了它们可以导航到本地目录并毫无问题地打开文件。
以前有人遇到过这种怪事吗?
编辑 ZippyV - 典型子示例
Public Sub PDF_Functions_LogCalls_RunReport(ByVal Customer As Boolean)
Try
Dim vOutput As String = LogCalls_Run(Customer)
If Left(vOutput, 5) = "Error" Then
TaskDialog.Show(MainForm, AppBoxError("File Error", vOutput, "Error"))
Exit Sub
End If
If System.IO.File.Exists(vOutput) Then
Dim P As New Process
P.StartInfo.FileName = vOutput
P.StartInfo.Verb = "Open"
P.Start()
End If
Catch ex As Exception
EmailError(ex)
Exit Sub
End Try
End Sub
【问题讨论】:
-
startinfo中的值是什么?