string filename = @"c: est.txt";
int numberoflines = 10;
StreamReader reader = new StreamReader(); //pick appropriate Encoding
reader.BaseStream.Seek(0, SeekOrigin.End);
int count = 0;
while ((count < numberoflines) && (reader.BaseStream.Position > 0))
{
reader.BaseStream.Position--;
int c = reader.BaseStream.ReadByte();
if (reader.BaseStream.Position > 0)
reader.BaseStream.Position--;
if (c == Convert.ToInt32('
'))
{
++count;
}
}
string str = reader.ReadToEnd();
string[] arr = str.Replace("
", "").Split('
');
reader.Close();