CSDN博客

img yangrongcan

MSDN QUOTA源代码

发表于2004/10/19 10:53:00  963人阅读

Example

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

[Visual Basic .NET]

Dim globalAdmin As New SPGlobalAdmin()

Dim uri As New System.Uri("http://Server_Name")
Dim virtualServer As SPVirtualServer = globalAdmin.OpenVirtualServer(uri)
Dim siteCollection As SPSite = virtualServer.Sites("http://Site_Name")
Dim globalConfig As SPGlobalConfig = globalAdmin.Config

siteCollection.Quota = globalConfig.QuotaTemplates("Quota_Template_Name") 

[C#]

SPGlobalAdmin globalAdmin = new SPGlobalAdmin();

System.Uri uri = new System.Uri("http://Server_Name");

SPVirtualServer virtualServer = globalAdmin.OpenVirtualServer(uri);
SPSite siteCollection = virtualServer.Sites["http://Site_Name"];

SPGlobalConfig globalConfig = globalAdmin.Config;
siteCollection.Quota = globalConfig.QuotaTemplates["Quota_Template_Name"]; 
阅读全文
0 0

相关文章推荐

img
取 消
img