C# 用C语言调用exe程序#

C# 用C语言调用exe程序#,c#,C#,如何调用从一个c#文件生成的exe,从另一个c#文件生成的exe?System.Diagnostics.Process.Start(“任何文件的路径,包括exe”)如果要在执行之前生成C#文件,可以使用编译C#文件,然后使用执行输出文件 您可以在提供的链接中找到每种方法的示例。可能重复的 using System.Diagnostics; string command = @"C:\tmp\myExe.exe -my -params"; ProcessStartInfo procStartI

如何调用从一个c#文件生成的exe,从另一个c#文件生成的exe?

System.Diagnostics.Process.Start(“任何文件的路径,包括exe”)

如果要在执行之前生成C#文件,可以使用编译C#文件,然后使用执行输出文件

您可以在提供的链接中找到每种方法的示例。

可能重复的
using System.Diagnostics;

string command = @"C:\tmp\myExe.exe -my -params";

ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd", "/c " + command)
    {
        RedirectStandardOutput = true,
        UseShellExecute = false,
        CreateNoWindow = true
    };

using (Process proc = new Process())
{
    proc.StartInfo = procStartInfo;
    proc.Start();

    return proc.StandardOutput.ReadToEnd();
}