【语言-c#】C# 启动exe

来源:互联网 发布:2016年欧洲杯网络直播 编辑:程序博客网 时间:2024/05/16 15:07
using System.Diagnostics;    Process exep = new Process(); //创建一个进程        exep.StartInfo.FileName = "calc.exe";//启动程序        exep.StartInfo.Arguments = "";//附加参数        FileInfo info = new FileInfo("d:\\test\\my.txt");        exep.StartInfo.WorkingDirectory = info.Directory.ToString(); //工作路径 d:\\test        exep.StartInfo.CreateNoWindow = false;        exep.StartInfo.UseShellExecute = true;        exep.Start();        // exep.WaitForExit() ();//关键,等待外部程序退出后才能往下执行        //int ec = exep.ExitCode;


0 0
原创粉丝点击