WPF C#:打开pdf文件

时间:2014-02-13 13:16:23

标签: c# wpf pdf uri

我已经在我的应用程序中添加了一个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”的异常 有什么建议吗?

0 个答案:

没有答案
相关问题