Have you ever written a Console application in VB.NET and wished you could send all those Console.WriteLine's to, say, a file instead? Boy, I sure have. And here's how... it's horribly easy.

Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    
    Dim sw As New System.IO.StreamWriter("C:\convertOut.txt")
    Dim oldOut As System.IO.TextWriter
    
    oldOut = Console.Out
    
    Console.WriteLine("test1")
    Console.SetOut(sw)
    Console.WriteLine("test2")
    
    sw.Flush()
    sw.Close()
    
    Console.SetOut(oldOut)
    Console.WriteLine("test3")
End Sub