語言

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 物件相關的開放網際網路連線數量。

// 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()))

備註

注意事項

WebRequest、、HttpWebRequest、ServicePointWebClient、和 都已過時,你不應該用它們來做新開發。 請改用 HttpClient。

該 CurrentConnections 屬性包含與此 ServicePoint 物件相關的開放網路連線數量。 的 CurrentConnections 值不能超過的 ConnectionLimit值。

Note

此特性僅在 .NET Framework 上實作。

適用於