使用 StreamWriter 将行单独写入文本文件

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

当使用 Implements IDisposable 的对象时,建议使用 Using 块