I am using the following code to get the latest file from a folder. Now, my requirement is to get the oldest file from the list, instead of the latest one. I don’t see the OrderByAscending function to use. Can someone help please?
Directory.GetFiles(“Path”,“ORCH"+".xlsx”).OrderByDescending(Function(d) New FileInfo(d).LastWriteTime).Where(Function(n) not path.GetFileName(n).Contains("~$"))(0)