共用方式為


SPQuotaTemplateCollection.Add method

建立配額範本物件在集合中。

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

Syntax

'宣告
Public Sub Add ( _
    qt As SPQuotaTemplate _
)
'用途
Dim instance As SPQuotaTemplateCollection
Dim qt As SPQuotaTemplate

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

參數

Examples

下列程式碼範例會建立配額範本的配額範本目前部署的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 class

SPQuotaTemplateCollection members

Microsoft.SharePoint.Administration namespace