Share via


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

注解

通道属性用于在运行时配置通道。 有关可能的通道属性和示例的列表,请参阅 通道和格式化程序配置属性

适用于

另请参阅