-3

I have a solution with two projects:

  • Windows forms application
  • Console application.

I want to manage the console application from the windows form application.
How cant i start/stop the console application from the windows forms applciation?

can any one provide a sample code or any suggestion?

Banana
  • 7,424
  • 3
  • 22
  • 43

1 Answers1

2

What you are looking for is Process.Start:

using System.Diagnostics;
...

Process process = new Process();
process.StartInfo.FileName = "yourexe.exe";
process.Start();
process.WaitForExit();// Waits here for the process to exit.

For further information take a look at this StackOverflow link.

Community
  • 1
  • 1
oopbase
  • 11,157
  • 12
  • 40
  • 59