static void Main(string[] args) { //这个两上便利类,可以读写文本文件 using (StreamWriter writer = new StreamWriter(@"c:exerciseabc.txt",true)) { writer.WriteLine("这个句子是我加上去的"); } //读文本文件 using (StreamReader reader = new StreamReader(@"c:exerciseabc.txt")) { while (reader.EndOfStream == false) { Console.WriteLine(reader.ReadLine()); } } Console.ReadKey(); }