Using sw As New System.IO.StreamWriter("path\to\file.txt") sw.WriteLine("Hello world") End Using
在使用Using实现的对象时,建议使用块IDisposable