Freigeben über


SPPrefixCollection.Add-Methode

Fügt das angegebene Präfix der Auflistung hinzu.

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

Syntax

'Declaration
Public Function Add ( _
    strPrefix As String, _
    type As SPPrefixType _
) As SPPrefix
'Usage
Dim instance As SPPrefixCollection
Dim strPrefix As String
Dim type As SPPrefixType
Dim returnValue As SPPrefix

returnValue = instance.Add(strPrefix, _
    type)
public SPPrefix Add(
    string strPrefix,
    SPPrefixType type
)

Parameter

  • strPrefix
    Typ: System.String

    Eine Zeichenfolge, die das Präfix enthält. Dies ist eine serverrelative URL-Pfad, der länger als MaxPrefixLengthwerden kann.

Rückgabewert

Typ: Microsoft.SharePoint.Administration.SPPrefix
Ein SPPrefix -Objekt.

Beispiele

Das folgende Beispiel schließt den angegebenen Pfad als Platzhalter, was bedeutet, dass mehrere Pfad basierte Websitesammlungen unter dieser URL-Pfad erstellt werden können.

Dim webApplication As SPWebApplication.Lookup(new Uri("http://machinename"))
Dim prefixCollection As SPPrefixCollection = webApplication.Prefixes
prefixCollection.Add("Path", Microsoft.SharePoint.Administration.SPPrefixType.WildcardInclusion)
SPWebApplication webApplication = 
   SPWebApplication.Lookup(new Uri("http://machinename"));
SPPrefixCollection prefixCollection = webApplication.Prefixes;
prefixCollection.Add("Path", SPPrefixType.WildcardInclusion);

Siehe auch

Referenz

SPPrefixCollection Klasse

SPPrefixCollection-Member

Microsoft.SharePoint.Administration-Namespace