Bagikan melalui


ServicePoint.ConnectionName Properti

Definisi

Mendapatkan nama koneksi.

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

Nilai Properti

String yang mewakili nama koneksi.

Contoh

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

Keterangan

Hati

WebRequest, HttpWebRequest, ServicePoint, dan WebClient usang, dan Anda tidak boleh menggunakannya untuk pengembangan baru. Gunakan HttpClient sebagai gantinya.

Jika objek ServicePoint dibangun dengan memanggil kelebihan beban FindServicePoint dengan argumen Uri, maka properti ConnectionName mewakili properti Scheme dari objek Uri yang digunakan.

Jika objek ServicePoint dibangun dari host jaringan dan port, properti ConnectionName berisi string yang mewakili host dan port jaringan. Jika properti ConnectionName diatur saat dibangun dari host dan port, hanya WebRequest objek dengan nilai ConnectionGroupName yang sama yang dapat menggunakan objek ServicePoint ini.

Berlaku untuk

Lihat juga

  • Pengelompokan Koneksi