Dim objStreamWriter As StreamWriter 'Pass the file path and the file name to the StreamWriter constructor.
objStreamWriter = New StreamWriter("C:\Test.txt")
'Write a line of text.
objStreamWriter.WriteLine("Hello World")
'Write a second line of text.
objStreamWriter.WriteLine("From the StreamWriter class")
'Close the file.
objStreamWriter.Close()