Choose Category
using System; using System.IO; namespace forgetCode { class Program { static void Main(string[] args) { string path = "D:\\test.txt"; if (File.Exists(path)) { string content = File.ReadAllText(path); Console.WriteLine("Current content of file:"); Console.WriteLine(content); } Console.WriteLine("\nPlease enter the new content"); string newContent = Console.ReadLine(); File.WriteAllText(path, newContent); } } }