Bagikan melalui


HttpClientChannel.Item[Object] Properti

Definisi

Mengembalikan properti saluran yang ditentukan.

public:
 virtual property System::Object ^ default[System::Object ^] { System::Object ^ get(System::Object ^ key); void set(System::Object ^ key, System::Object ^ value); };
public override object this[object key] { get; set; }
member this.Item(obj) : obj with get, set
Default Public Overrides Property Item(key As Object) As Object

Parameter

key
Object

Kunci properti saluran yang akan diambil.

Nilai Properti

Object yang mewakili properti saluran yang ditentukan oleh key.

Contoh

Contoh kode berikut menunjukkan cara menggunakan Item[] properti . Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk HttpClientChannel kelas .

// Display the channel's properties using Keys and Item.
for each(String^ key in clientChannel->Keys)
{
    Console::WriteLine("clientChannel[{0}] = <{1}>", key, clientChannel[key]);
}
// Display the channel's properties using Keys and Item.
foreach(string key in clientChannel.Keys)
{
    Console.WriteLine(
        "clientChannel[{0}] = <{1}>",
        key, clientChannel[key]);
}

Berlaku untuk