本文介绍了SharePoint,您如何以编程方式确定 SPWeb 的存储大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
不是网站集本身,而是各个 SPWeb 的.
Not of the site collection itself, but the individual SPWeb's.
推荐答案
您应该看看 Alexander Meijers 的这篇博客文章:基于文件夹和文件的 SPWeb 大小
You should take a look at this blog entry by Alexander Meijers : Size of SPWeb based on its Folders and Files
它提供了一种通过遍历内容来查找 SPWeb 或 SPFolder 大小的巧妙方法.
It provides a clever way of finding the size of an SPWeb or SPFolder by iterating through his content.
private long GetWebSize(SPWeb web)
{
long total = 0;
foreach (SPFolder folder in web.Folders)
{
total += GetFolderSize(folder);
}
foreach (SPWeb subweb in web.Webs)
{
total += GetWebSize(subweb);
subweb.Dispose();
}
return total;
}
这篇关于SharePoint,您如何以编程方式确定 SPWeb 的存储大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!