ServicePoint.ConnectionName 属性

定义

获取连接名。Gets the connection name.

public:
 property System::String ^ ConnectionName { System::String ^ get(); };
public string ConnectionName { get; }
member this.ConnectionName : string
Public ReadOnly Property ConnectionName As String

属性值

String

一个表示连接名的 StringA String that represents the connection name.

示例

Console::WriteLine( "ConnectionName = {0}", sp->ConnectionName );

// Display the maximum number of connections allowed on this 
// ServicePoint instance.
Console::WriteLine( "ConnectionLimit = {0}", sp->ConnectionLimit );

// Display the number of connections associated with this 
// ServicePoint instance.
Console::WriteLine( "CurrentConnections = {0}", sp->CurrentConnections );

Console.WriteLine("ConnectionName = " + sp.ConnectionName);

// Display the maximum number of connections allowed on this
// ServicePoint instance.
Console.WriteLine("ConnectionLimit = " + sp.ConnectionLimit);

// Display the number of connections associated with this
// ServicePoint instance.
Console.WriteLine("CurrentConnections = " + sp.CurrentConnections);
Console.WriteLine(("ConnectionName = " + sp.ConnectionName))

' Display the maximum number of connections allowed on this 
' ServicePoint instance.
Console.WriteLine(("ConnectionLimit = " + sp.ConnectionLimit.ToString()))

' Display the number of connections associated with this 
' ServicePoint instance.
Console.WriteLine(("CurrentConnections = " + sp.CurrentConnections.ToString()))

注解

如果 ServicePoint 对象是通过调用 FindServicePoint 具有参数的重载构造的 Uri ,则 ConnectionName 属性表示所 Scheme Uri 使用对象的属性。If the ServicePoint object was constructed by calling a FindServicePoint overload with a Uri argument, then the ConnectionName property represents the Scheme property of the Uri object used.

如果 ServicePoint 对象是从网络主机和端口构造的,则 ConnectionName 属性包含表示主机和网络端口的字符串。If the ServicePoint object was constructed from a network host and port, the ConnectionName property contains a string that represents the host and the network port. 如果该 ConnectionName 属性是从主机和端口构造的,则只有 WebRequest 具有相同值的对象 ConnectionGroupName 才能使用此 ServicePoint 对象。If the ConnectionName property is set when constructed from a host and port, only WebRequest objects with the same ConnectionGroupName value can use this ServicePoint object.

适用于