csharp read last 10 lines of file

Code Example - csharp read last 10 lines of file

                
                        var nrOfPagesToRead = 10;
var lastLines = File.ReadLines(filePath).TakeLast(nrOfPagesToRead);
// careful because ReadLines(path) reads all the file in memory.
// Do not use this for large files.