在.NET Framework中,我可以简单地做,但是在Process.Start(filename);
.NET Core中,我会遇到此异常:
System.ComponentModel.Win32Exception:'指定的可执行文件不是此OS平台的有效应用程序。
如何开始testfile.txt
使用默认应用程序?谢谢!
像这样打开它:
new Process
{
StartInfo = new ProcessStartInfo(filename)
{
UseShellExecute = true
}
}.Start();