C#获取如何获取指定路径文件夹下所有文件的个数??、急急急

给大神跪了
2025-03-25 10:09:10
推荐回答(4个)
回答1:

System.IO.Directory.GetFiles("path路径").Count()

回答2:

 Directory.GetFiles(Path).Length;

;

回答3:

直接这样

Directory.GetFiles(Path).Length;

回答4:

DirectoryInfo info = new DirectoryInfo(@"D:/");
MessageBox.Show(info.GetFiles().Count().ToString());