语言

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.ToString());
' Display the ServicePoint Internet resource address.
Console.WriteLine(("Address = " + sp.Address.ToString()))

注解

Caution

WebRequest、 HttpWebRequest、 ServicePoint和 WebClient 已过时,不应将其用于新开发。 改用 HttpClient。

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

注释

此属性仅在 .NET Framework 上实现。

适用于