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:


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