I need my program to count the number of files on a disk drive.
What is the fastest way to do so?
Directory.GetFiles() is not an alternative, as it is very slow.
Did you try import kernel32.dll
and use it?
There is a good implementation example someone posted before here : https://stackoverflow.com/a/724184/912851. It might be worthwhile looking at.
Edit: The fastest one I saw in my life is this application. It uses ntfs journals. and within seconds it lists millions of files on my harddisk. I think they have a sdk and sources on C++ or c. Maybe you can create a managed dll and use on c#?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With