c#根据文件路径启动进程
2021-06-19 16:04
标签:director code red dia cts lse span string stat c#根据文件路径启动进程 标签:director code red dia cts lse span string stat 原文地址:https://www.cnblogs.com/zhaogaojian/p/10281604.html //根据文件路径启动进程
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);
}