SPSite.Quota 属性

Gets or sets a quota for the site collection.

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
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; }

属性值

类型:Microsoft.SharePoint.Administration.SPQuota
An SPQuota object that represents the quota.

示例

The following code example uses the Quota property to apply a quota template to a site collection on the specified virtual server.

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"]; 
}

备注

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

另请参阅

引用

SPSite 类

SPSite 成员

Microsoft.SharePoint 命名空间