Redirect console.writeline ?

Riemann

Member
Joined
Sep 24, 2003
Messages
13
Is it possible to make it so that any output in a program via console.writeline is written to a text file instead of to the console?
 
Woops! Nevermind. Already got it. Much easier than I thought.

Code:
Dim Writer As New IO.StreamWriter("c:\Temp.txt", False)
Console.SetOut(Writer)

That will redirect console output to c:\Temp.txt
 
Back
Top