【发布时间】:2022-01-01 17:42:33
【问题描述】:
我在 Windows 11 中使用 C#。
PhotoViewer 是我 PC 上 AVI 文件的默认应用程序。我正在尝试使用“Process.Start”方法启动带有 AVI 文件的 PhotoViewer,如下所示:
MessageBox.Show(fn + " exists? " + File.Exists(fn));
Process.Start("@" + fn);
MessageBox 输出是“d:\dscf0001.avi 存在吗?是的。”
Process.Start 引发 Win32Exception 并显示消息“系统找不到指定的文件。”
我做错了什么?
【问题讨论】:
-
这个“@”字符串是干什么用的?
-
这能回答你的问题吗? Open file with associated application
标签: c# process.start photoviewer