سؤال

هل هناك أي طريقة لمعرفة مقدار المساحة الحرة المتبقية في موقع SharePoint؟أحتاج إلى العثور عليه بواسطة واجهة الصابون. شكرا لتعليقاتك.

هل كانت مفيدة؟

المحلول

if memory servers me correct there is no webservice that would do what your asking for!

you need to make a custom webservice and within the code add,

public string getWarninglevel(string url)
{
      using (SPSite siteCollection = new SPSite(url))
      {
       //the warning level when reached
       return siteCollection.Quota.StorageWarningLevel.ToString();
      }
}

public string getMaxlevel(string url)
{
      using (SPSite siteCollection = new SPSite(url))
      {
       //your max storage you can have
       siteCollection.Quota.StorageMaximumLevel.ToString();
      }
}

public string getCurrentlevel(string url)
{
      using (SPSite siteCollection = new SPSite(url))
      {
       //your total storage avaiable
       return siteCollection.Usage.Storage.ToString();
      }
}

im returning string for simplicity ;)

to make a webservice either follow any of these:

http://blog.sharepointbits.com/2010/04/custom-wcf-services-in-sharepoint-2010_17.html

or

http://blogs.msdn.com/b/ericwhite/archive/2010/07/16/writing-and-hosting-a-web-service-in-the-sharepoint-2010-demo-virtual-machine.aspx

or

http://msdn.microsoft.com/en-us/library/ms464040(v=office.14).aspx

within the browser when you do vti_bin/SiteQuto.asmx you would/should have those three methods to use. The last one is the one you are looking for!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top