I am trying to pull that last 5 lines from a .csv file and display them in a datagrid on my form. How would I insert the data onto the datagrid?
Here is my current Code,
int x = 5;
var buffor = new Queue<string>(x);
var log = new StreamReader(@"MyPath");
while (!log.EndOfStream)
{
string line = log.ReadLine();
if (buffor.Count >= x)
buffor.Dequeue();
buffor.Enqueue(line);
}
string[] lastLines = buffor.ToArray();
Thanks in advance.