How to display SharePoint Site Storage

Sometimes you want to display the storage allocated for a particular SharePoint site, and fortunatly the SPSite.UsageInfo structure provides this information. In order to display the site storage for a site, here is the code:

[csharp]

float single;
try
{
single = (float) (((double) web.Site.Usage.Storage) / 1048576);
}
catch (Exception exception)
{
throw new Exception(“Error in Site Storage Collection:
” + exception.ToString());
}

[/csharp]

Share

One thought on “How to display SharePoint Site Storage”

Leave a Reply

Your email address will not be published. Required fields are marked *