问题描述
主题说明如何检查特定文件夹中的文件和文件夹总数,并确定该文件夹的总大小。我将使用VB.NET。一个小的代码片段会很棒。
谢谢
As the subject says how can I check total # of files and folders in a particular folder and determine the total size of that folder. I will be using VB.NET. A small code snippet will be great.
Thanks
推荐答案
感谢您的帮助。实际上我曾经是一年前的开发人员,现在我在基础设施,所以我有点忘记了这些东西。我知道如何使用递归循环,我将使用它。所有我需要知道如何获得根文件夹的大小。
Thanks for the help. Actually I used to be a developer one year ago, now I am in infrastructure, so I am kinda forgetting the stuff. I know how to use recursive loop, I will use that. All I need to know how to get the size of the root folder.
嗯,这就是问题所在。您无法获得根文件夹大小而无需递归遍历所有子目录,获取所有文件并添加其大小。
希望有所帮助。
Well, that''s the thing. You can''t get the root folder size without recursively looping through all the subdirs, getting all the files and adding up their sizes.
Hope that helps.
这篇关于如何检查文件和文件夹的总数#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!