File count from a folder

前端 未结 10 2421
天命终不由人
天命终不由人 2020-11-27 03:47

How do I get number of Files from a folder using ASP.NET with C#?

10条回答
  •  广开言路
    2020-11-27 03:59

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

    You can use this.

提交回复
热议问题