I have a requirement to search for specific files from a designated folder and i have got success in getting those filtered files based on the search criteria i am passing inside my code.
But i need to sort the filtered files based on their creation date as i want to fetch the oldest created file from the filtered files.
Since there can be around 100K records present in the directory, i am facing performance issue in fetching the single file. Below is the code i have written to fetch the filtered files.
filePaths = System.IO.Directory::GetFiles(inputDirectory,fileToFilter);
// Here inputdirectory variable is the target folder and fileToFilter is something like ABC.
Even the count of filtered items can be more than 100 or 200 so need to sort the files with created date time.
Can any one help me in adding the sort operation by Creation date/Time ?