static void Main(string[] args) { string fileName = @"logFile3.txt"; ReadFile(fileName); Console.ReadLine(); } static void ReadFile(string fileName) { long num = 0; using (FileStream fs = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (BufferedStream bs = new BufferedStream(fs)) using (StreamReader sr = new StreamReader(bs)) { string str; while ((str = sr.ReadLine()) != null) { ++num; if(num%100==0) { string[] arr = str.Split(new char[] { ' ' }); Console.WriteLine(num); Console.WriteLine(arr[arr.Length-2]); } } } }