CSharp examples for File IO:Text File
Read a text file
using System;//from w ww.j a va2s . c o m using System.IO; class Program { static void Main(string[] args) { StreamReader reader = new StreamReader("main.cs"); string contents = reader.ReadToEnd(); Console.WriteLine("File contents:"); Console.WriteLine(contents); reader.Close(); } }