共用方式為


SPPrefix Class

Represents a specified relative URL that is used to determine segments of the URL under which SPSite objects may be created.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.Administration.SPPrefix

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Class SPPrefix _
    Inherits SPAutoSerializingObject
'Usage
Dim instance As SPPrefix
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class SPPrefix : SPAutoSerializingObject

Remarks

Use the Prefixes of the SPWebApplication class to return the collection of prefixes for a Web application.

Use an indexer to return a single prefix from the collection. For example, if the collection is assigned to a variable named myPrefixes, use myPrefixes[index] in C#, or myPrefixes(index) in Visual Basic, where index is the index number of the prefix in the collection.

When a request to the Web application is received by the Web server, SharePoint Foundation examines the URL path of the request to determine whether the request should be handled by SharePoint Foundation or by IIS. Inclusions specifywhat URL paths are handled by SharePoint Foundation.

There are two types of prefixes, wildcard and explicit. An explicit inclusion means that that the URL represents a site. A wildcard inclusion means that the inclusion plus every segment after it represents a site. For example, the explicit inclusion '/' indicates that the root of the Web application is a site. The wildcard inclusion 'sites' indicates that /sites/Site1 and /sites/Site2 are both sites. Exclusions are obsolete and are ignored. Any file or path that is defined in the metabase is automatically excluded by SharePoint Foundation.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPPrefix Members

Microsoft.SharePoint.Administration Namespace