ServicePoint.CurrentConnections 属性

定义

获取与此 ServicePoint 对象关联的打开连接数。

public:
 property int CurrentConnections { int get(); };
public int CurrentConnections { get; }
member this.CurrentConnections : int
Public ReadOnly Property CurrentConnections As Integer

属性值

与此 ServicePoint 对象关联的打开连接数。

示例

下面的代码示例使用 CurrentConnections 属性来确定与此 ServicePoint 对象关联的打开 Internet 连接数。

// Display the ServicePoint Internet resource address.
Console::WriteLine( "Address = {0}", sp->Address );
// Display the ServicePoint Internet resource address.
Console.WriteLine("Address = {0} ", sp.Address.ToString());
' Display the ServicePoint Internet resource address.
Console.WriteLine(("Address = " + sp.Address.ToString()))

注解

谨慎

WebRequestHttpWebRequestServicePointWebClient 已过时,不应将其用于新开发。 请改用 HttpClient

CurrentConnections 属性包含与此 ServicePoint 对象关联的打开 Internet 连接数。 CurrentConnections 的值不能超过 ConnectionLimit的值。

适用于