共用方式為


SPWeb.IsRootWeb Property

Gets a Boolean value that indicates whether the site is the top-level website of the site collection.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public ReadOnly Property IsRootWeb As Boolean
    Get
'Usage
Dim instance As SPWeb
Dim value As Boolean

value = instance.IsRootWeb
public bool IsRootWeb { get; }

Property Value

Type: System.Boolean
true if the site is the top-level website; otherwise, false.

See Also

Reference

SPWeb Class

SPWeb Members

Microsoft.SharePoint Namespace