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
)
參數
strPrefix
Type: System.String內含之字首的字串。這是不能超過MaxPrefixLength伺服器相對 URL 路徑。
type
Type: Microsoft.SharePoint.Administration.SPPrefixType指定的前置字元類型SPPrefixType值。
傳回值
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);