SPQuotaTemplateCollection.Add 方法

在集合中创建配额模板对象。

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

语法

声明
Public Sub Add ( _
    qt As SPQuotaTemplate _
)
用法
Dim instance As SPQuotaTemplateCollection
Dim qt As SPQuotaTemplate

instance.Add(qt)
public void Add(
    SPQuotaTemplate qt
)

参数

示例

下面的代码示例创建配额模板的配额模板的当前部署的Microsoft SharePoint Foundation集合中。

Dim webService As New SPWebService()
Dim tempCollection As SPQuotaTemplateCollection = webService.QuotaTemplates

Dim newTemplate As New SPQuotaTemplate()

newTemplate.Name = "MyTemplate "
newTemplate.StorageMaximumLevel = 20000000 'bytes
newTemplate.StorageWarningLevel = 10000000 'bytes

tempCollection.Add(newTemplate) 
SPWebService webService = new SPWebService();
SPQuotaTemplateCollection tempCollection = webService.QuotaTemplates;

SPQuotaTemplate newTemplate = new SPQuotaTemplate();

newTemplate.Name = "MyTemplate";
newTemplate.StorageMaximumLevel = 20000000 //bytes;
newTemplate.StorageWarningLevel = 10000000 //bytes;

tempCollection.Add(newTemplate);

另请参阅

引用

SPQuotaTemplateCollection 类

SPQuotaTemplateCollection 成员

Microsoft.SharePoint.Administration 命名空间