你在windows窗体的load事件里注册服务器就行了
try:
TcpChannel tcpChannel=new TcpChannel (port);
ChannelServices.RegisterChannel (tcpChannel);
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .Bank ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .BankBinding ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .Customer ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .EtcCard ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .EtcTagLog ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .Location ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .User ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .Vehicle ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .VehicleClass ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .VehicleType ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .OperatorReport ));
try:
TcpChannel tcpChannel=new TcpChannel (port);
ChannelServices.RegisterChannel (tcpChannel);
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .Bank ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .BankBinding ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .Customer ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .EtcCard ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .EtcTagLog ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .Location ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .User ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .Vehicle ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .VehicleClass ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .VehicleType ));
RemotingConfiguration.RegisterActivatedServiceType (typeof(IERD.EtcTag .Data .OperatorReport ));
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货