且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在vb.net中写入文本文件

更新时间:2023-09-21 22:43:46

请参见
http://www.homeandlearn.co.uk/net/nets8p4.html [ ^ ]
http://msdn.microsoft.com/en-us/library/6ka1wd3w.aspx#Y0 [^ ]
http://www.techrepublic.com/article/使用visual-basic-net/1045309读取和写入文本文件 [
See
http://www.homeandlearn.co.uk/net/nets8p4.html[^]
http://msdn.microsoft.com/en-us/library/6ka1wd3w.aspx#Y0[^]
http://www.techrepublic.com/article/read-and-write-text-files-with-visual-basic-net/1045309[^]



在这里,我提供用于创建文本文件并将数据写入其中的代码
Hi,
Here I''m providing code for creating text file and writing data to it
File.Create("pathof folder");
      StreamWriter sw = new StreamWriter("pathofrequiredfile");
      sw.WriteLine("");
      sw.Close();



尝试此操作,您必须导入System.IO;

一切顺利



Try this and you''ve to import System.IO;

All the best