补充一下:在启动程序的 Main 中注册一个服务端的服务对象,代码如下:// 注册服务
TcpServerChannel channel =
new TcpServerChannel(AppConfig.CurrentConfig.TcpPort);//TcpPort 是一整数。ChannelServices.RegisterChannel(channel);WellKnownServiceTypeEntry remObj =
new WellKnownServiceTypeEntry(
typeof(MyService),
"MyServer/MyService",
WellKnownObjectMode.SingleCall);// 由客户端每次调用时激活RemotingConfiguration.RegisterWellKnownServiceType(remObj);
TcpServerChannel channel =
new TcpServerChannel(AppConfig.CurrentConfig.TcpPort);//TcpPort 是一整数。ChannelServices.RegisterChannel(channel);WellKnownServiceTypeEntry remObj =
new WellKnownServiceTypeEntry(
typeof(MyService),
"MyServer/MyService",
WellKnownObjectMode.SingleCall);// 由客户端每次调用时激活RemotingConfiguration.RegisterWellKnownServiceType(remObj);
HkeyCurrentUser\Software\Microsoft\Windows\CurrentVersion\Internet Settings
You can do this by program and you only need to do this once before you
establish the connection. If The connection is established you can set it
back to the original state. It is a binary value. Set the first byte to 01
to enable autodial and to 00 to disable it.