I need to get a count of the number of files in a directory. I could get the names of all the files in the directory using System.IO.Directory.GetFiles() and t
There is no faster way. No matter what you use, it all boils down to FindFirstFile and FindNextFile Win32 calls.
You could try using something like this, but it will probably take just as much time -- but maybe with a little less memory usage (= probably not worth it).