using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Count
{
class Program
{
static void Main(string[] args)
{
string f = @"
long count = 0;
using (StreamReader r = new StreamReader(f))
{
while ((r.ReadLine()) != null)
{
count++;
if (count % 100000 == 0) //number indicates etap counts
{
System.Console.WriteLine(count.ToString() + " lines and counting");
}
}
System.Console.WriteLine(count.ToString() + " total lines");
System.Console.ReadLine();
}
}
}
}
 
Keine Kommentare:
Kommentar veröffentlichen