File I/O Basics
C# provides the System.IO namespace to work with the computer's file system.
Write to File
csharp string text = "Hello File!"; File.WriteAllText("test.txt", text);
Read from File
csharp string content = File.ReadAllText("test.txt"); Console.WriteLine(content);
Always ensure the path is correct and your application has permissions.