通过


HttpClientChannel.Keys 属性

定义

ICollection获取通道属性与之关联的键。

public:
 virtual property System::Collections::ICollection ^ Keys { System::Collections::ICollection ^ get(); };
public override System.Collections.ICollection Keys { get; }
member this.Keys : System.Collections.ICollection
Public Overrides ReadOnly Property Keys As ICollection

属性值

ICollection通道属性与之关联的键。

示例

下面的代码示例演示如何使用该 Keys 属性。 该代码示例是 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]);
}

注解

通道属性用于在运行时配置通道。 有关可能的通道属性和示例的列表,请参阅 Channel 和 Formatter 配置属性

适用于

另请参阅