Gewusst wie: Festlegen der authenticationMode-Konfigurationseigenschaft
Mit diesem Beispielcode wird veranschaulicht, wie die authenticationMode-Konfigurationseigenschaft programmgesteuert festgelegt wird.
Beispiel
// 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);
Kompilieren des Codes
Für dieses Beispiel ist Folgendes erforderlich:
- Verweise auf die Namespaces System, System.Collections und System.Runtime.Remoting.Channels.Tcp.