Number of lines in a txt file in C#

If you are wondering about number of lines in a text file you are about to read, you could simply use this code to find it out
[code language="csharp"]
int cnt = File.ReadLines("file_Path.txt").Count();
[/code]