I have a console application which does a set of operations and gives out messages after completion of each operation. When I run my console app, the messages in my console window may look like this:
Checking prerequisites...
Completing prerequisites..
Performing installation...
Completing installation...
Done..!
Now I'm executing this console application from one of my C# windows applications by using Process.StartInfo(). I need to get all the messages thrown by my console application to be displayed in the windows form of my application.
Can this be done?
Thanks.
This can be quite easily achieved using the ProcessStartInfo.RedirectStandardOutput Property. A full sample is contained in the linked MSDN documentation.
Look here Capturing console output from a .NET application (C#)