Partager via


SelfServiceCreateSite(String, String, String, UInt32, String, String, String, String, String, String, String) Method

The SelfServiceCreateSite method of the SPSite class creates a site collection by using Self-Service Site Creation.

Parameters

strSiteUrl   A string that contains the absolute URL for the site collection.

strTitle   A string that contains the title for the site collection.

strDescription   A string that contains the description for the site collection.

nLCID   An unsigned 32-bit integer that specifies the locale identifier (LCID).

strWebTemplate   A string that contains the name of the site definition to use to create the site collection.

strOwnerLogin   A string that contains the user name for the site collection owner.

strOwnerName   A string that contains the display name for the site collection owner.

strOwnerEmail   A string that contains the e-mail address for the site collection owner.

strContactLogin   A string that contains the user name for the secondary contact.

strContactName   A string that contains the display name for the secondary contact.

strContactEmail   A string that contains the e-mail address for the secondary contact.

Return Value

A Microsoft.SharePoint.SPSite object that represents the new site collection.

Remarks

The SelfServiceCreateSite method throws an exception of type ArgumentException if the value passed for the strSiteUrl parameter does not specify an absolute URL. If this method is called when Self-Service Site Creation is disabled on the server, an exception of type Microsoft.SharePoint.SPException is thrown.

Example

The following code example uses the SelfServiceCreateSite method to create a new site collection based on the STS site template.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security