Number of files in a directory.

  • Thread starter Thread starter supster
  • Start date Start date
S

supster

EDIT: I no longer need only specific file types in a directory, just
the total number of files!

Is there a more efficient way other than this:

string[] files = Directory.GetFiles(path);
count = files.length;


It seems like such a waste to have to create a full array of strings,
specially when the folder may contain thousands of files.

Thanks
 
Back
Top