CSharp examples for File IO:Text File
Reading Text from a File
using System;//from w w w .j av a 2s .c om using System.IO; public class Reading { public static void Main(String[] args) { string buffer; StreamReader myFile = File.OpenText("main.cs"); while ( (buffer = myFile.ReadLine()) != null ) { Console.WriteLine(buffer); } myFile.Close(); } }