One thought on “How to Count the Number of Files in a folder

  1. Hi Jack

    There is a build in function in ASP.net that allows you to access the directory information that you can use to get the file count for the folder.

    The following is a sample code that you can use:

    System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo("SourcePath");
    int count = dir.GetFiles().Length;

Comments are closed.