any problems with doing this?
int i = new StreamReader(\"file.txt\").ReadToEnd().Split(new char[] {\'\\n\'}).Length
That should do the trick:
using System.Linq; .... int i = File.ReadLines(file).Count();