C# How do I use Directory.GetFiles() to get files that have the same order as in Windows explorer?

Viewed 4921

Is is possible to get files that is ordered same as in Windows Explorer

I know "natural sort", but it's not what I need, I need to get the file list ordered by the same attribute in Windows Explorer, for example:

If I ordered a directory by the attribute "create date", then I will get a file list as below:

name                    create date    file size
1.txt                   2012/1/1        125Kb
2.tab                   2012/3/2        15Kb
3.bmp                   2013/5/5        26Kb

If my windows explorer order file list with the attribute "file size", the the file list would be:

name                     create date    file size
2.tab                    2012/3/2        15Kb
3.bmp                    2013/5/5        26Kb
1.txt                    2012/1/1        125Kb

Could anyone help?

7 Answers
Related