Trying to get all xml files in a directory but need to get the oldest first.
String[]=Directory.GetFiles(in_Config(“FolderPath”).ToString,“*.XML”, SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime)
Trying several ways, but ending up getting
Value of type ‘System.Linq.IOrderedEnumerable(Of String)’ cannot be converted to ''1-dimensional array of String.
Can you try to add .ToArray() at the end of the expression as the following?
String[]=Directory.GetFiles(in_Config(“FolderPath”).ToString,"*.XML", SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).ToArray()