SPSite.Port 属性

Gets the port number that is used for input and output on the virtual server that contains the site collection.

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

语法

声明
Public ReadOnly Property Port As Integer
    Get
用法
Dim instance As SPSite
Dim value As Integer

value = instance.Port
public int Port { get; }

属性值

类型:System.Int32
A 32-bit integer that indicates the port number.

示例

The following code example displays the port number for the specified site collection in a console application.

Using oSiteCollection As New SPSite("http://" + System.Environment.MachineName)
    Console.WriteLine(("port: " + oSiteCollection.Port.ToString()))
End Using
using (SPSite oSiteCollection = new SPSite("http://" + 
   System.Environment.MachineName))
{
    Console.WriteLine("port: " + oSiteCollection.Port.ToString());
}

备注

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 命名空间