50,526
社区成员
发帖
与我相关
我的任务
分享
int fileCount = 0, folderCount = 0;
long length = 0;
File folder = new File("D:\\lalla");
File []list = folder.listFiles();
for (File file : list){
if (file.isFile()){
fileCount++;
length += file.length();
}else {
folderCount++;
}
}