I have some directories containing test data, typically over 200,000 small (~4k) files per directory.
I am using the following C# code to get the number of files in a di
If you just need a file count, I found that using 'EnumerateFiles()' is much quicker than using 'GetFiles()':
/*
String[] Files = Directory.GetFiles(sPath, "*.*", SearchOption.AllDirectories);
Int32 nCount = Files.Length;
*/
Int32 nCount = 0;
var MyFiles = Directory.EnumerateFiles(sPath, "*.*", SearchOption.AllDirectories);
foreach (String sFile in MyFiles) nCount++;
Console.WriteLine("File Count: {0}", nCount);