代码如下:
//string path = Path.Combine(Environment.SystemDirectory, "ssText3d.scr");
//string path = @"C:\Windows\System32\ssText3d.scr";
string path = @"D:\ssText3d.scr";
Console.WriteLine(path);
Process p = new Process();
p.StartInfo.FileName = path;
p.Start();`
如上代码,可以正常执行。
但是这个文件本身就存在System32文件夹下,想直接调用,但是更改为注释的路径执行此代码会报如下错误:
Unhandled Exception: System.ComponentModel.Win32Exception: The system cannot find the file specified
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
还请大神帮忙看一下,多谢啦~