0

I have a console application which I run through a WinForms application, which waits for the application to finish. How can I retrieve the output of the console application in my GUI, and what is the best way to wait for the console application to finish?

Tetsujin no Oni
  • 7,222
  • 2
  • 28
  • 46
ZoRo
  • 381
  • 2
  • 4
  • 10
  • Any help in this question? http://stackoverflow.com/questions/4291912/process-start-how-to-get-the-output – Shoban Feb 01 '12 at 05:29
  • 1
    Are they both .NET assemblies? If so, it would likely be easier for one application to call public methods of the other application than to implement interprocess communication. – Cody Gray Feb 01 '12 at 05:40
  • Reworded assuming the console app is no-source-available. – Tetsujin no Oni Feb 01 '12 at 06:03

2 Answers2

1

It is possible with "Process" class. Please refer to the ProcessStartInfo.RedirectStandardOutput Property example available in the below link.

http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput.aspx

Hope this helps.

Karthik Mahalingam
  • 1,106
  • 8
  • 10
0

Look up Inter-Process Communication

Since you're using .Net. See WCF Named-Pipes for example.

kervin
  • 11,482
  • 5
  • 41
  • 58