Check out example codes for "c# console save file". It will help you in understanding the concepts better.

Code Example 1

FileStream filestream = new FileStream("out.txt", FileMode.Create);
var streamwriter = new StreamWriter(filestream);
streamwriter.AutoFlush = true;
Console.SetOut(streamwriter);
Console.SetError(streamwriter);

Learn ReactJs, React Native from akashmittal.com