C#执行EXE程序
2021-06-06 20:03
标签:proc name create exe程序 start process 执行 inf system 第一种方法: C#执行EXE程序 标签:proc name create exe程序 start process 执行 inf system 原文地址:https://www.cnblogs.com/qiu18359243869/p/10765689.html
System.Diagnostics.ProcessStartInfo info =new System.Diagnostics.ProcessStartInfo(path);
info.WorkingDirectory = Path.GetDirectoryName(path); System.Diagnostics.Process.Start(info);
第二中方法:
System.Diagnostics.Process.Start(path)
第三种方法:
Process p =new Process();
p.StartInfo.FileName ="cmd.exe";
p.StartInfo.UseShellExecute =false;
p.StartInfo.RedirectStandardInput =true;
p.StartInfo.RedirectStandardOutput =true;
p.StartInfo.RedirectStandardError =true;
p.StartInfo.CreateNoWindow =true;
p.StartInfo.WorkingDirectory = Application.StartupPath +@"\FormGen\";
p.Start();
p.StandardInput.WriteLine("FormGen.exe");
p.StandardInput.WriteLine("exit");