title: How to find the second latest file in folder
body: <p>I want to access a folder through my C# code,and open up the <strong>2nd</strong> most recently updated/created file. This is because the most recent file is always being used by a different process, so I cannot access it properly.</p>
  
  <p>I have found code to find the most recent file, and it is:</p>
  
  <pre><code>var DataLogFile = (from f in directory.GetFiles()
                     orderby f.LastWriteTime descending
                     select f).First();
  </code></pre>
  
  <p>I am unsure of how to edit it in order to find the file I am looking for. I know it'll probably be the one after the first one in descending order, but I have no idea how to access it.</p>