vb.net如何在D盘新建一个test.ini文件呢?
1个回答
展开全部
'创建一个文本文件,把文本框里的文字写入到该文件,当然,你可以使用一个字符串变量
Dim MyStream As New System.IO.FileStream("D:\test.ini", System.IO.FileMode.Create)
Dim MyWriter As New System.IO.StreamWriter(MyStream, System.Text.Encoding.Default)
MyWriter.WriteLine(TextBox1.Text)
MyWriter.Flush()
MyWriter.Close()
MyStream.Close()
Dim MyStream As New System.IO.FileStream("D:\test.ini", System.IO.FileMode.Create)
Dim MyWriter As New System.IO.StreamWriter(MyStream, System.Text.Encoding.Default)
MyWriter.WriteLine(TextBox1.Text)
MyWriter.Flush()
MyWriter.Close()
MyStream.Close()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询