GetFiles sort order

  • Thread starter Thread starter Tim Kelley
  • Start date Start date
T

Tim Kelley

When I perform a Directory.GetFiles() what order should the files be
returned? I would think it would be alpha, but when I read files off of a CF
card it appears to be random.

Thanks.

Tim
 
When I perform a Directory.GetFiles() what order should the files be
returned? I would think it would be alpha, but when I read files off of a CF
card it appears to be random.

Thanks.

Tim

Hi,

Why you would think that?
You are getting a list of files, not a sorted list of files.
You have to sort it yourself, not a difficult task anyway:
Array a =Directory.GetFiles("xxxxx");
Array.Sort( a);
 
Back
Top