int countRows = 0;
using (OpenFileDialog op = new OpenFileDialog())
{
if (op.ShowDialog() == DialogResult.OK && System.IO.File.Exists(op.FileName))
{
using (System.IO.StreamReader streamReader = new System.IO.StreamReader(op.FileName))
{
string line = string.Empty;
while ((line = streamReader.ReadLine()) != null)
{
if(line != "")
countRows++;
}
}
}
}