1: static void StorageQuery()
2: {
3: DataTable dtStorageInformation;
4: using (SPSite spsSitio=new SPSite("http://demo2010a:100/"))
5: {
6: dtStorageInformation=
7: spsSitio.StorageManagementInformation(
8: SPSite.StorageManagementInformationType.Document,
9: SPSite.StorageManagementSortOrder.Decreasing,
10: SPSite.StorageManagementSortedOn.Size,
11: 1000);
12: var drStorageInformation =
13: dtStorageInformation.Select();
14:
15: foreach (var dr in drStorageInformation)
16: {
17:
18: Console.WriteLine(
19: dr["Directory"] + " - " +
20: dr["LeafName"] + " - " +
21: dr["TotalSize"] + " - " +
22: dr["Size"]);
23: }
24: }