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

C#调用exe程序

时间:2020-05-02 11:59:20      阅读:68      评论:0      收藏:0      [点我收藏+]

标签:shel   als   output   ecc   out   and   stand   exist   for   

private void ExecCheckExe()
{
    string exefile = "d:\\chktool\\checktool.exe";
    if (File.Exists(exefile))
    {
        Process process = new Process();
        ProcessStartInfo startInfo = new ProcessStartInfo(exefile);
        startInfo.UseShellExecute = false;
        startInfo.RedirectStandardOutput = true;
        startInfo.CreateNoWindow = true;
        process.StartInfo = startInfo;
        process.Start();
        process.WaitForExit(2000);
        string output = process.StandardOutput.ReadToEnd();

        process.Close();
    }
}

C#调用exe程序

标签:shel   als   output   ecc   out   and   stand   exist   for   

原文地址:https://www.cnblogs.com/jiftle/p/12817207.html

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