码迷,mamicode.com
首页 > Windows程序 > 详细

C# 打开exe文件

时间:2017-06-15 12:56:52      阅读:288      评论:0      收藏:0      [点我收藏+]

标签:getdir   start   put   inf   err   cut   exec   app   new   

第一种方法:

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

C# 打开exe文件

标签:getdir   start   put   inf   err   cut   exec   app   new   

原文地址:http://www.cnblogs.com/zhijianyuan/p/7016627.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!