Freigeben über


SPSite.SelfServiceCreateSite-Methode (String, String, String, UInt32, String, String, String, String, String, String, String, String)

Creates a site collection by using Self-Service Site Creation based on the specified quota template and other information.

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

Syntax

'Declaration
Public Function SelfServiceCreateSite ( _
    siteUrl As String, _
    title As String, _
    description As String, _
    nLCID As UInteger, _
    webTemplate As String, _
    ownerLogin As String, _
    ownerName As String, _
    ownerEmail As String, _
    contactLogin As String, _
    contactName As String, _
    contactEmail As String, _
    quotaTemplate As String _
) As SPSite
'Usage
Dim instance As SPSite
Dim siteUrl As String
Dim title As String
Dim description As String
Dim nLCID As UInteger
Dim webTemplate As String
Dim ownerLogin As String
Dim ownerName As String
Dim ownerEmail As String
Dim contactLogin As String
Dim contactName As String
Dim contactEmail As String
Dim quotaTemplate As String
Dim returnValue As SPSite

returnValue = instance.SelfServiceCreateSite(siteUrl, _
    title, description, nLCID, webTemplate, _
    ownerLogin, ownerName, ownerEmail, _
    contactLogin, contactName, contactEmail, _
    quotaTemplate)
public SPSite SelfServiceCreateSite(
    string siteUrl,
    string title,
    string description,
    uint nLCID,
    string webTemplate,
    string ownerLogin,
    string ownerName,
    string ownerEmail,
    string contactLogin,
    string contactName,
    string contactEmail,
    string quotaTemplate
)

Parameter

  • siteUrl
    Typ: System.String

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

  • title
    Typ: System.String

    A string that contains the title for the site collection.

  • description
    Typ: System.String

    A string that contains the description for the site collection.

  • nLCID
    Typ: System.UInt32

    An unsigned 32-bit integer that specifies the locale ID.

  • webTemplate
    Typ: System.String

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

  • ownerLogin
    Typ: System.String

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

  • ownerName
    Typ: System.String

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

  • ownerEmail
    Typ: System.String

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

  • contactLogin
    Typ: System.String

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

  • contactName
    Typ: System.String

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

  • contactEmail
    Typ: System.String

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

  • quotaTemplate
    Typ: System.String

    A string that contains the name of the quota template.

Rückgabewert

Typ: Microsoft.SharePoint.SPSite
An SPSite object that represents the new site collection.

Hinweise

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 SPException is thrown.

Beispiele

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

Using oSiteCollection As New SPSite("http://" + System.Environment.MachineName)
    Dim oSiteCollectionSelfServ As SPSite = oSiteCollection.SelfServiceCreateSite("Absolute_URL", "Title", "Description", Locale_ID, "STS", "Owner_User_Name", "Owner_Display_Name", "Owner_E-mail", "Contact_User_Name", "Contact_Display_Name", "Contact_E-mail")

    oSiteCollectionSelfServ.Dispose()
End Using
using(SPSite oSiteCollection = new SPSite("http://" + System.Environment.MachineName))
{
    SPSite oSiteCollectionSelfServ = oSiteCollection.SelfServiceCreateSite("Absolute_URL", "Title",
    "Description", Locale_ID, "STS", "Owner_User_Name",
    "Owner_Display_Name",  "Owner_E-mail",
    "Contact_User_Name", "Contact_Display_Name", "Contact_E-mail");

    oSiteCollectionSelfServ.Dispose();
}

Hinweis

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

Siehe auch

Referenz

SPSite Klasse

SPSite-Member

SelfServiceCreateSite-Überladung

Microsoft.SharePoint-Namespace