C#winform添加Txt文件,不重复录入且不清空
时间:2017-07-04 13:25:04 阅读:203 评论:0 收藏:0 [点我收藏+]
标签: private void textLog_TextChanged(object sender, EventArgs e) FileStream fs = new FileStream(@"C:\\文件导入记录日志.txt", FileMode.Open); } 标签: 原文地址:
{
StreamReader Reader = new StreamReader(fs);
string strLine = Reader.ReadLine();
while (strLine!=null && strLine!="")
{
strLine = Reader.ReadLine();
}
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine(strLine+textLog.Text);
sw.Flush();
sw.Close();
fs.Close();
踩
(0)
赞
(0)
举报
评论 一句话评论(0)
,