共用方式為


SPPrefixCollection.Add method

將指定的前置詞新增至集合。

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

Syntax

'宣告
Public Function Add ( _
    strPrefix As String, _
    type As SPPrefixType _
) As SPPrefix
'用途
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
)

參數

傳回值

Type: Microsoft.SharePoint.Administration.SPPrefix
SPPrefix 物件。

Examples

下列範例會為萬用字元表示可建立此 URL 路徑下的多個路徑型網站集合包含指定的路徑。

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);

請參閱

參照

SPPrefixCollection class

SPPrefixCollection members

Microsoft.SharePoint.Administration namespace