Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何打开控制台应用程序?_C# - Fatal编程技术网

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

C# 如何打开控制台应用程序?,c#,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 wo

如何从另一个窗口中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!");
    }
  }
}
使用
Process.Start(“ConsoleApp.exe的路径”)

使用
Process.Start(“到ConsoleApp.exe的路径”)

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