📜  streamreader 覆盖了我的文本文件,但我想更新 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:18.604000             🧑  作者: Mango

代码示例1
string file = File.ReadAllText(@".\path\to\file.txt");
file = file + "Some string I'm adding to my file";
File.WriteAllText(@".\path\to\file.txt", file); // note this overwrites the file