This would be a great time to read the MSDN docs that have pretty useful examples:

http://msdn.microsoft.com/en-us/libr...ardoutput.aspx

http://msdn.microsoft.com/en-us/libr...treadline.aspx