In Directory.GetFiles | In Explorer | |
04.html | 1.html | |
040.html | 3.html | |
05.html | 04.html | |
1.html | 05.html | |
10.html | 10.html | |
3.html | 040.html |
If you have access to the source then you can pass the string array returned from Directory.GetFiles to Array's Sort(Array, IComparer) method to sort it in numeric order.
If you do not have access to the source then you can modify the registry as below for explorer to sort using the alphabetic order. Restart explorer for the changes to take effect.
For current user:[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
For the System:
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
Value Name: NoStrCmpLogical
Type: REG_DWORD
Value:1
Disclaimer: Modifying the registry can cause serious problems that may require you to reinstall your operating system. Use the information provided at your own risk.
No comments:
Post a Comment