hi,
how to get the number of files in a directory...including the files in the
subdirectories...

is there any default method of Directory class..
please help out

RE: finding files in adirectory by DK

DK
Tue Jun 05 09:07:02 CDT 2007

Hi,

I think the only way to do this would be to use the getFiles method, there
is a value that you can set to include the subdirectories as well. It returns
a String array. Then you have to find do an <array>.count to get the number
of files. I had the same issue and this is how I went about it. I understand
there is an unnecessary traffic from database to the application, but there
is no straight mehthod available in the .net framework to just get the count
of files. The following link from MS has more info about the method itself.
Hope this helps!

http://msdn2.microsoft.com/en-us/library/ms143316(VS.80).aspx


DKumar


"AVL" wrote:

> hi,
> how to get the number of files in a directory...including the files in the
> subdirectories...
>
> is there any default method of Directory class..
> please help out

Re: finding files in adirectory by Herfried

Herfried
Tue Jun 05 13:58:08 CDT 2007

"AVL" <AVL@discussions.microsoft.com> schrieb:
> how to get the number of files in a directory...including the files in the
> subdirectories...

<URL:http://dotnet.mvps.org/dotnet/samples/filesystem/FileSystemEnumerator.zip>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>