共用方式為


SPSite.Quota property

取得或設定網站集合的配額。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Property Quota As SPQuota
    Get
    Set
'用途
Dim instance As SPSite
Dim value As SPQuota

value = instance.Quota

instance.Quota = value
public SPQuota Quota { get; set; }

Property value

Type: Microsoft.SharePoint.Administration.SPQuota
SPQuota 物件,表示配額。

Examples

下列程式碼範例會使用Quota屬性,來將配額範本套用到指定的虛擬伺服器上的網站集合。

Dim uriNew As New Uri("http://Server_Name")
Dim oWebApp As SPWebApplication = SPWebApplication.Lookup(uriNew)

Using oSiteCollection As SPSite = oWebApp.Sites("http://Site_Name")
    oSiteCollection.Quota = SPWebService.ContentService.QuotaTemplates("Quota_Template_Name")
End Using
Uri uriNew = new Uri("http://Server_Name"); 
SPWebApplication oWebApp = SPWebApplication.Lookup(uriNew);

using(SPSite oSiteCollection = oWebApp.Sites["http://Site_Name"])
{
    oSiteCollection.Quota = SPWebService.ContentService.QuotaTemplates["Quota_Template_Name"]; 
}
注意事項注意事項

某些物件實作IDisposable介面,並且您必須避免之後不再需要保留這些物件在記憶體中。良好的程式碼撰寫方式的相關資訊,請參閱Disposing Objects

請參閱

參照

SPSite class

SPSite members

Microsoft.SharePoint namespace