Two simple ways to read and write files in C#.
async Task<string> ReadFromFileAsync(string filePath) { using (TextReader file = File.OpenText(filePath)) { return await file.ReadLineAsync(); } }
async Task WriteToFileAsync(string filePath, string text) { using (TextWriter tw = File.CreateText(filePath)) { await tw.WriteAsync(text); } }