Dim path As String = "c:\temp\MyTest.txt"
If File.Exists(path) = False Then' Create a file to write to.
Dim sw As StreamWriter = File.CreateText(path)
sw.WriteLine("这里就是我要查看的数据")
sw.Flush()
sw.Close()
End If
本文展示了如何使用 C# 语言创建并写入文本文件的基本操作,包括检查路径是否存在、创建文件、写入数据及关闭文件流。
Dim path As String = "c:\temp\MyTest.txt"
If File.Exists(path) = False Then
被折叠的 条评论
为什么被折叠?