VB.NET 写入文件实例

VB.NET写入文件实例

Imports System
Imports System.IO

Class Test
Public Shared Sub Main()
'' Create an instance of StreamWriter to write text to a file.
Dim sw As StreamWriter = New StreamWriter("TestFile.txt")
'' Add some text to the file.
sw.Write("This is the ")
sw.WriteLine("header for the file.")
sw.WriteLine("-------------------")
'' Arbitrary objects can also be written to the file.
sw.Write("The date is: ")
sw.WriteLine(DateTime.Now)
sw.Close()
End Sub
End Class

 转载请注明出处:

转载自http://lxfamn.cn/blog

未经允许不得转载:lxfamn » VB.NET 写入文件实例

赞 (0) 打赏

置顶推荐

评论 0

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏