c#读写txt
2020-12-13 14:09
阅读:267
标签: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(); c#读写txt 标签:io os sp bs ad line new app file 原文地址:http://www.cnblogs.com/heifengwll/p/4058938.html
评论
亲,登录后才可以留言!