문제

I am pretty new to Sharepoint, but I am wondering if there is a way to get the maximum allocated space for a Sharepoint Site Collection, Site, and Recycle Bin?

I know to get the size of a Site Collection you could use nameOfSPSite.Usage.Storage to get the size of site collection, but I am looking for a way to get the maximum storage capacity, so I can show users how close their Site Collection, Site, or Recycle Bin are to their limits. I need to also do this programaticly in C#.

Thanks

도움이 되었습니까?

해결책

You want to know the nameOfSPSite.Quota

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.quota.aspx

Edit: the Storage property contains the Recycle Bin usage in it, to specifically get the size from the Recycle Bin you need to sum the items in it, something like:

var rbTotal = SPContext.Current.Site.RecycleBin.OfType<SPRecycleBinItem>().Sum(rbi => rbi.Size)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top