CSharp examples for File IO:Text File
Read text file with auto close statement
using System;/*from ww w . j a v a 2 s .c o m*/ using System.IO; class Program { static void Main(string[] args) { using (StreamReader reader = new StreamReader("test-file.txt")) { string contents = reader.ReadToEnd(); Console.WriteLine("File contents:"); Console.WriteLine(contents); } } }