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

Code Example 1

using System;
using System.IO;
using System.Text;

namespace StreamReaderReadToEnd
    class Program
        static void Main(string[] args)
            var path = @"C:\Users\Jano\Documents\thermopylae.txt";

            using var fs = new FileStream(path, FileMode.Open, FileAccess.Read);
            using var sr = new StreamReader(fs, Encoding.UTF8);
            string content = sr.ReadToEnd();


Code Example 2

//this will get a string with all the text from the file
var fileText = File.ReadAllText(@"path\to\my\file.txt");

//this will get all of the lines of the file as an string[]
var fileLines = File.ReadAllLines(@"path\to\my\file.txt");

Learn ReactJs, React Native from