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
DK - 05 Jun 2007 15:07 GMT
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
> 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
Herfried K. Wagner [MVP] - 05 Jun 2007 19:58 GMT
"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>

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