Need to get just last line from big log file. What is the best way to do that?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Or you can do it two line (.Net 4 only)
You want to read the file backwards using
ReverseLineReader
:How to read a text file reversely with iterator in C#
Then run
.Take(1)
on it.You'll want to use Jon Skeet's library MiscUtil directly rather than copying/pasting the code.