Home

Published

- 1 min read

c# count files in directory and subdirectories

img of c# count files in directory and subdirectories

The solution for this is noted below

c# count files in directory and subdirectories

Solution

   var countFiles = System.IO.Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories).Count();

Try other methods by searching on the site. That is if this doesn’t work