all groups > c# > july 2004 >
You're in the

c#

group:

Number of files in a directory.


Number of files in a directory. prelugejunk NO[at]SPAM hotmail-dot-com.no-spam.invalid
7/31/2004 8:02:42 PM
c#: 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
Re: Number of files in a directory. clintonG
7/31/2004 9:37:25 PM
A very large number...
http://www.microsoft.com/resources/documentation/Windows/XP/all/reskit/en-us/Default.asp?url=/resources/documentation/Windows/XP/all/reskit/en-us/prkc_fil_tdrn.asp


<%= Clinton Gallagher


[quoted text, click to view]

AddThis Social Bookmark Button