共用方式為


HttpChannel.Item[Object] 屬性

定義

傳回指定的通道屬性。

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

參數

key
Object

要擷取的通道屬性索引鍵。

屬性值

Object,表示由 key 指定的通道屬性。

範例

下列程式碼範例示範如何使用 Item[] 屬性。 此程式代碼範例是針對 類別提供的較大範例的 HttpClientChannel 一部分。

// 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]);
}

適用於