如何:设置 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);
编译代码
此示例要求:
- 对 System、System.Collections 和 System.Runtime.Remoting.Channels.Tcp 命名空间的引用。