using System.IO; private void ReadFile(string fileName) { string line; try { //Create an instance of StreamReader to read from a file. using (StreamReader sr= new StreamReader (fileName)) { while(sr.Peek ()>-1) { line=sr.ReadLine(); } } } catch (Exception Ex) { Console.WriteLine(Ex.Message); } }
沒有留言:
張貼留言