title: Read previous line using File.ReadLines
body: <p>I want to read a text file from last line because it could be big size and just want to check today's log content. </p>
  
  <p>I'm using <code>File.ReadLines</code>() and success to read last line. 
  How can I read the previous line? 
  Or is there any way to get the current line number so that I can subtract the number?</p>
  
  <pre><code>foreach (string f in Directory.GetFiles(sDir, "*.log", SearchOption.AllDirectories))
  {
      string last = File.ReadLines(f, Encoding.Default).Last(); //read Last Line here
  
      if (last.IndexOf("error", StringComparison.OrdinalIgnoreCase) &gt; 0)
      {
          WriteError(last);
      }
  }
  </code></pre>