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

前端 未结 7 1132
萌比男神i
萌比男神i 2020-12-11 19:12

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 th

7条回答
  •  情书的邮戳
    2020-12-11 20:01

    I think you would have to write a shell extension for windows explorer that captures sort events on columns and writes that metadata to disk in some structured way. You may have multiple explorer windows open so might be an idea to apply timestamp or id so you know which explorer window you are dealing with. Then in your app read that metadata to get the sort order and apply accordingly. Not easy but doable.

提交回复
热议问题