SPSite.PortalName 属性

Gets or sets the name of a portal. (Read-only in 沙盒解决方案.)

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

语法

声明
Public Property PortalName As String
    Get
    Set
用法
Dim instance As SPSite
Dim value As String

value = instance.PortalName

instance.PortalName = value
public string PortalName { get; set; }

属性值

类型:System.String
A string that contains the portal name.

备注

The PortalName property must be set together with the PortalUrl property to establish a connection to a portal site. The PortalUrl property must be specified first and the PortalName property second.

示例

The following code example uses the PortalName property to establish a connection to a portal site from the specified site collection.

Using oSiteCollection As New SPSite("http://Server_Name/sites/Site_Name")
    oSiteCollection.PortalUrl = "http://Portal_Site/"
    oSiteCollection.PortalName = "Portal_Name"
End Using
using (SPSite oSiteCollection = new SPSite("http://Server_Name/sites/Site_Name"))
{
    oSiteCollection.PortalUrl = "http://Portal_Site/";
    oSiteCollection.PortalName = "Portal_Name";
}

备注

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

另请参阅

引用

SPSite 类

SPSite 成员

Microsoft.SharePoint 命名空间