C#winform向Txt文件传值,不重复录入且不清空

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(); }
上一篇:【转载】彻底弄懂css中单位px和em,rem的区别


下一篇:[leetcode] 15. Plus One