标签:io os sp bs ad line new app file
附加到txt:StreamWrite sw =System.IO.File.AppendText(path); //绝对路径 sw.Write("写入内容");
写入到txt: StreamWrite sw2 =new StreamWrite(); sw.Write("写入内容");
最后都要 sw.Close();
读取txt:StreamReader sr = new StreamReader(path); //绝对路径 string line=""; while((line=sr.ReadLine())!=null){//操作行} 最后关闭流 sw.Close();
标签:io os sp bs ad line new app file
原文地址:http://www.cnblogs.com/heifengwll/p/4058938.html