SPWebApplicationBuilder class
會建立SPWebApplication物件,此物件提供的所有必要的值 ; 預設設定如此一來,來電者必須只會不同的屬性值從預設的變更。
Inheritance hierarchy
System.Object
Microsoft.SharePoint.Administration.SPWebApplicationBuilder
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Class SPWebApplicationBuilder
'用途
Dim instance As SPWebApplicationBuilder
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class SPWebApplicationBuilder
Examples
下列範例會使用SPWebApplicationBuilder 999 的連接埠上建立新的 SharePoint Web 應用程式。範例建立和佈建的 Web 應用程式,然後建立新的網站集合和最上層網站的根目錄。
Dim webAppBuilder As New SPWebApplicationBuilder(SPFarm.Local)
Dim myPort As Integer = 999
webAppBuilder.Port = myPort
Dim newApplication As SPWebApplication = webAppBuilder.Create()
newApplication.Provision()
Dim mySiteCollection As SPSite = newApplication.Sites.Add("/", "DOMAIN\UserAlias", "user@microsoft.com")
mySiteCollection.Close()
SPWebApplicationBuilder webAppBuilder = new SPWebApplicationBuilder(SPFarm.Local);
int myPort = 999;
webAppBuilder.Port = myPort;
SPWebApplication newApplication = webAppBuilder.Create();
newApplication.Provision();
SPSite mySiteCollection = newApplication.Sites.Add("/", "DOMAIN\\UserAlias", "user@microsoft.com");
mySiteCollection.Close();
Thread safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.