我已经在我的应用程序中添加了一个pdf文件作为内容,我试图在单击按钮时启动它,但我不太确定为什么它不想工作。
以下是代码:
private void AppDoc_Click(object sender, RoutedEventArgs e)
{
try
{
Uri uri = new Uri("/UserGuide_PDF.pdf", UriKind.Relative);
System.Diagnostics.Process.Start(uri.LocalPath);
}
catch
{
MeBox.Show("The file location could not be found.", "Location Not Found", MessageBoxButton.OK, MessageBoxImage.Warning);
}
我收到一条说“System.InvalidOperationException”的异常 有什么建议吗?