zl程序教程

您现在的位置是:首页 >  后端

当前栏目

C#调用exe程序

c#程序 调用 exe
2023-09-27 14:22:02 时间

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();
    }
}