any problems with doing this?
int i = new StreamReader(\"file.txt\").ReadToEnd().Split(new char[] {\'\\n\'}).Length
Assuming the file exists and you can open it, that will work.
It's not very readable or safe...