Hi, I have a lot of files in a folder. These files have a date and time in a file name in a specific format. I need to extract the date from the name and then sort it by date in ascending order. Example file name: -
format_type_2011-07-12-13-00-12.txt
I used to use createTime. But now the requirement is changed.
var Files = new DirectoryInfo(FileDirectory).GetFiles() .OrderBy(f => f.CreationTime) .ToList();
How can I do it? Any help is appreciated.
source share