James Mercer
James Mercer

Reputation: 111

How do you open a console application?

How do you open a console application from a "button" on a windows form in another window. Examples would be awesome.

Say this is the code:

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!");
    }
  }
}

Upvotes: 0

Views: 1196

Answers (2)

Stefan
Stefan

Reputation: 14880

Use Process.Start("path to ConsoleApp.exe")

Process.Start(string)

Upvotes: 2

Svisstack
Svisstack

Reputation: 16616

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

Upvotes: 2

Related Questions