Visual Basic .NET Language Write Lines Individually to a Text File using StreamWriter


Example

Using sw As New System.IO.StreamWriter("path\to\file.txt")
    sw.WriteLine("Hello world")
End Using

The use of a Using block is recommended good practice when using an object that Implements IDisposable