HttpClientChannel.Item[Object] 属性

定义

返回指定的信道属性。Returns the specified channel property.

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

要检索的信道属性的键。The key of the channel property to retrieve.

属性值

Object

一个 Object,表示由 key 指定的信道属性。A Object that represents the channel property specified by key.

示例

下面的代码示例说明如何使用 Item[] 属性。The following code example shows how to use the Item[] property. 此代码示例是为类提供的更大示例的一部分 HttpClientChannelThis code example is part of a larger example provided for the HttpClientChannel class.

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

适用于