SPSite oSite = new SPSite("http://mpacificomoss/"); Console.WriteLine("SITE URL:" +oSite.Url); DataTable oDtRawData = null; // this line of code will return the stroage information of all the document lirbaries in this site oDtRawData = oSite.StorageManagementInformation(SPSite.StorageManagementInformationType.DocumentLibrary
, SPSite.StorageManagementSortOrder.Increasing, SPSite.StorageManagementSortedOn.Size, 100); // this line of code will return the stroage information of all the lists in this site oDtRawData = oSite.StorageManagementInformation(SPSite.StorageManagementInformationType.List
, SPSite.StorageManagementSortOrder.Increasing, SPSite.StorageManagementSortedOn.Size, 100); // this line of code will return the stroage information of all the Documents in this site oDtRawData = oSite.StorageManagementInformation(SPSite.StorageManagementInformationType.Document
, SPSite.StorageManagementSortOrder.Increasing, SPSite.StorageManagementSortedOn.Size, 10000); // if you wan to see column names, loop through all the columns and find out the names and grab the needed one. foreach (DataColumn oColumn in oDtRawData.Columns) { Console.WriteLine(oColumn.ColumnName); } // loop through all the rows and find out the values. Here the size will be return in bytes (size/1024 = size in KBs) foreach (DataRow oRow in oDtRawData.Rows) { Console.WriteLine(oRow["TotalSize"].ToString() + " : " + oRow["Size"].ToString() + " : " + oRow["SizeOfVersions"].ToString() + " : " + oRow["LeafName"].ToString()); }
0 comments:
Post a Comment