//根据文件路径启动进程
private static void StartProcessByFilePath(string path)
{
Process p = new System.Diagnostics.Process();
p.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(path);
p.StartInfo.FileName = System.IO.Path.GetFileName(path);
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = false;
p.StartInfo.RedirectStandardOutput = false;
p.StartInfo.RedirectStandardError = false;
p.StartInfo.CreateNoWindow = true;
Process.Start(path);
}
相关文章
- 根据路径或url获取文件名和文件大小
- 错误:PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。“+文件路径“的解决方案
- 如何修改启动jupyter的文件路径
- (转)C#读取文件路径
- 如何获取Springboot项目运行路径 (idea 启动以及打包为jar均可) 针对无服务器容器新建上传文件路径(适用于win 与 linunix)
- 根据文件路径 获取文件名的三种方法
- C# 项目获得路径文件方法总结
- iis启动网站报错:另一个程序正在使用此文件,进程无法访问。(异常来自HRESULT-0x80070020)
- Git Extensions system.invalidoperationexception尚未提供文件名,因此无法启动进程
- C#根据进程名称获取进程的句柄?