I want to extract all file names in a order as they exist in window explorer. I have googled and found many answers but this did not work. I have a file names in following order:
video_1
video_2
video_3
video_10
video_15
video_20
video_21
I want in the same order but the result comes in the following form.
video_1
video_10
video_10
video_2
video_20
video_21
I have tried the following codes:
var fileNames= Directory.GetFiles(basePath, "*" + fileExtension) //Not worked
DirectoryInfo info = new DirectoryInfo(basePath);
var filenames = info.GetFiles().OrderBy(p => p.CreationTIme).ToArray(); //Not worked
Can someone tell me how i can do this?