Tôi cần xác định số lượng tệp/thư mục con trong một thư mục. Tôi không quan tâm những tập tin/thư mục nào thực sự nằm trong thư mục đó. Có cách nào hiệu quả hơn việc sử dụngXác định số lượng tệp trong một thư mục
_directoryInfo.GetDirectories().Length +
_directoryInfo.GetFiles().Length
Cảm ơn.
trùng lặp: http://stackoverflow.com/questions/1192951/quicker-quickest-way-to-get-number-of-files-in-a-directory-with-over-200-000 -f http://stackoverflow.com/questions/349251/how-do-i-find-out-how-many-files-are-in-a-directory – JohnFx