March 15, 2014 Hot Topics: RSS RSS feed Download our iPhone app
Redirect I/O to a TextBoxWriter in .NET    • April 17, 2006   •
By Paul Kimmel   • Send Email »   • More Articles »  A data
stream is like a river where you set data adrift. You put data
on the river and it floats along, waiting to be plucked out at
some other location. As with streams in nature, you can move up
or down the stream, see what's there, and put in or take out
things. Streams in .NET work that way too. In .NET, the console
is represented by the stream class/metaphor. When you write a
statement such as Console.WriteLine, the argument to WriteLine
is put on the stream and it usually shows up in a command
window.  Sometimes, though, you want basic output to go
somewhere else besides the console (or DOS prompt). For example,
System.Diagnostics sends Debug statements to the Output window
in Visual Studio, and NUnit redirects Console.WriteLine
statements to an internal window in its NUnit GUI. Well, you can
redirect console output for your