Mega Code Archive

 
Categories / C# / File Stream
 

Read whole text file to the end

using System; using System.Data; using System.IO; class Class1{   static void Main(string[] args){             StreamReader sr = new StreamReader("practice.txt");       Console.WriteLine(sr.ReadToEnd());        sr.Close();        } }