Advertisement
kyrathasoft

get recursive file count

May 22nd, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.23 KB | None | 0 0
  1.     public static int GetDirectoryFileCount(string path)
  2.     {
  3.         int fileCount = 0;
  4.        
  5.         if(Directory.Exists(path))
  6.         {
  7.             fileCount = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories).Length;
  8.         }
  9.        
  10.         return fileCount;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement