如何:设置 authenticationMode 配置属性

此示例代码说明如何以编程方式设置 authenticationMode 配置属性。

示例

// Specify server channel properties.
IDictionary dict = new Hashtable();
dict["port"] = 9090;
dict["authenticationMode"] = "IdentifyCallers";
// Set up a server channel.
TcpServerChannel serverChannel = new TcpServerChannel(dict,null);
//Create an HttpChannel object and register the channel
ChannelServices.RegisterChannel(serverChannel);

编译代码

此示例要求:

请参见

概念

使用 TCP 信道进行身份验证