I want to access a folder through my C# code,and open up the 2nd 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.
I have found code to find the most recent file, and it is:
var DataLogFile = (from f in directory.GetFiles()
orderby f.LastWriteTime descending
select f).First();
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.