ServicePoint.ConnectionName 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得連接名稱。
public:
property System::String ^ ConnectionName { System::String ^ get(); };
public string ConnectionName { get; }
member this.ConnectionName : string
Public ReadOnly Property ConnectionName As String
屬性值
表示連接名稱的 String。
範例
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()))
備註
謹慎
WebRequest
、HttpWebRequest
、ServicePoint
和 WebClient
已經過時,您不應該將它們用於新的開發。 請改用 HttpClient。
如果使用 Uri 自變數呼叫 FindServicePoint 多載來建構 ServicePoint 物件,則 ConnectionName 屬性代表所使用 Uri 物件的 Scheme 屬性。
如果 ServicePoint 對像是從網路主機和埠建構的,則 ConnectionName 屬性會包含代表主機和網路埠的字串。 如果從主機和埠建構時設定 ConnectionName 屬性,則只有具有相同 ConnectionGroupName 值的 WebRequest 物件可以使用這個 ServicePoint 物件。