SPSite.Exists 方法 (Uri, Boolean)

Determines if a site with the specified uri exists. Checks the config db cache and, additionally, checks the content database if checkContentDb is true.

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Shared Function Exists ( _
    uri As Uri, _
    checkContentDb As Boolean _
) As Boolean
用法
Dim uri As Uri
Dim checkContentDb As Boolean
Dim returnValue As Boolean

returnValue = SPSite.Exists(uri, checkContentDb)
public static bool Exists(
    Uri uri,
    bool checkContentDb
)

参数

  • uri
    类型:System.Uri

    The exact, absolute url of a site. i.e. https://server/sites/sitename, not https://server/sites/sitename/subweb/default.aspx

  • checkContentDb
    类型:System.Boolean

    If true, does a deep check to see if the site collection is really existing in a content database. Otherwise, just looks up the site in config db cache, which may or may not be fresh.

返回值

类型:System.Boolean
true if the site exists; otherwise, false.

另请参阅

引用

SPSite 类

SPSite 成员

Exists 重载

Microsoft.SharePoint 命名空间