0

How do I output the entire contents of the Console window to a Text file when I'm done with it? I've tried searching for this but all I have come up with is a method to write the stream to a TextBox but I think that's a bit overkill, right?

jay_t55
  • 11,362
  • 28
  • 103
  • 174

1 Answers1

3

You could simply redirect the output of your console application to a file from a command prompt like this

myApplication.exe > log.txt

EDIT: On linux you could use the "tee" command (allows you to both display the output of the application and redirect it to a file); you might be able to find a Windows implementation for that command but I haven't used one myself

Stefan Ch
  • 329
  • 2
  • 7