How to direct output of console application to the screen?

  • Thread starter Thread starter Johann Schuler
  • Start date Start date
J

Johann Schuler

I'm learning C#. I want to direct a console application's output to a screen
where I can select and copy some of the text. How do I do this? Many thanks!
 
In any console program you can redirect output to a file and then use an editor
or something to view it but why bother ? Why not just make a new Windows program
which is just as easy.
 
Check out the ProcessStartInfo class which is in System.Diagnostics and
in particular the RedirectStandardOutput property. This will let you
redirect the standard output from a console program to a stream from
which you can then read the text.
 
Back
Top