Hi I have many files in a folder. Those files have date and time in the file name in specific format. I need to extract the date from the name and then sort it by date in ascending order. File Name example :-
format_type_2011-07-12-13-00-12.txt
Earlier I was using by createTime. But now requirement is changed.
var Files = new DirectoryInfo(FileDirectory).GetFiles()
.OrderBy(f => f.CreationTime)
.ToList();
How do i do it? Any help is appreciated.