You could try win32. If I remember the problem is that the collection
returns data once all files are processed. Win32 allows to return each name
in turn plus it could be quicker if you are not even interested in storing
details...
Also another option would be to closely look if you really need this number
(for example you could perhaps queue this to a file or a DB or in different
directories to avoid overblotting a single directory, or you could number
your files and using the last processed and last created could give a usable
value depdning what you are doing with this number etc...).
"MichiMichi" <> a écrit dans le message de news:
. com...
> My asp.net application has a directory which is filled up with over 17
> files (email) a second. After a while this sums up into a huge amount
> of files.
>
> I usually count files with the GETFILES method. This works perfectly
> of there are only a few hundert files in the folder
>
> *********
> ....
> Dim files() As String
> files = IO.Directory.GetFiles(mycontext.Server.MapPath(".\ myFolder
> \"), "*")
> ....
> *********
>
> When my application goes offline than it can happen that over 200,000
> files are waiting in the folder to be processed.
> The method GETFILES does not work anymore. There are just to many
> files. I can wait for hours any nothing happens.
>
> Is there a better method to count files inside a folder for ASP.NET
> 2.0?
>