Я не могу понять, как записать данные в файл без перезаписи. Я знаю, что могу использовать File.appendtext, но я не уверен, как подключить это к моему синтаксису. Вот мой код:
TextWriter tsw = new StreamWriter(@"C:\Hello.txt");
//Writing text to the file.
tsw.WriteLine("Hello");
//Close the file.
tsw.Close();
Я хочу, чтобы он записывал Hello каждый раз, когда я запускаю программу, а не перезаписывал предыдущий текстовый файл. Спасибо, что прочитали это.