📜  c# 读取文件的最后 10 行 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:07.090000             🧑  作者: Mango

代码示例1
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.