C# 打開exe文件


第一種方法:

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");


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM