你如何打开控制台应用程序?

时间:2011-03-05 19:45:30

标签: c#

如何从另一个窗口中的Windows窗体上的“按钮”打开控制台应用程序。例子很棒。

说这是代码:

namespace something
{
  class form1 : form
  {
    private void buttonPlay_Click(object sender, EventArgs e)
    {
    //I want whatever it would be to be put right here for this is the button that would be pressed
    }
  }
  class ConsoleApplication
  {
    public static void Method()
    {
      console.writeLine("hello World!");
    }
  }
}

2 个答案:

答案 0 :(得分:2)

Process.Start(@"console_app.exe");

答案 1 :(得分:2)

使用Process.Start("path to ConsoleApp.exe")

Process.Start(string)