LOL! Nevertheless, it could be done without knowing about "Binary sort",
"Bubble sort", "Shell sort" or something
Here is example how to sort files by its size:
private class SizeSorter : IComparer
{
int IComparer.Compare(object a, object b)
{
FileInfo afi = new FileInfo(a as string);
FileInfo bfi = new FileInfo(b as string);
return afi.Length.CompareTo(bfi.Length);
}
}
....
string [] f = Directory.GetFiles("currentdir", "*.*");
ArrayList al = new ArrayList(f);
al.Sort(new SizeSorter());
"al" will contain the sorted files.
--
Sergey Bogdanov
http://www.sergeybogdanov.com
Paul G. Tobey [eMVP] wrote:
> You'll have to sort them, using what you learned in your programming classes
> in college...
>
> Paul T.
>
> "Cyrille37" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> Peter Foot [MVP] a écrit :
>
>>System.IO.Directory.GetFiles("somefolder", "*.ext")
>
>
> And how to get them sorted by Date or by Size ?
>
> thanx.
>
>