public frmMain() { InitializeComponent(); this.StartPosition = FormStartPosition.CenterScreen; //此处请设置为从代理商处取得的激活码 Leey.Net.eTerm.LicenseManager.Instance.Key = "ceshiceshiceshi"; ec = new EtermConnection(); ec.OnReadPacket += new EtermConnection.CmdResultHandler(ec_OnReadPacket); ec.OnSendPacket += new EtermConnection.PacketHandler(ec_OnSendPacket); ec.OnLogin +=new Leey.Net.eTerm.Net.ObjectHandler(ec_OnLogin); ec.OnUnLogin+=new Leey.Net.eTerm.Net.ObjectHandler(ec_OnUnLogin); ec.OnEtermConnectionStateChanged+=new EtermConnection.EtermConnectionStateHandler(ec_OnEtermConnectionStateChanged); ec.OnGetChkCode += new EtermConnection.ChkCodeHandler(ec_OnGetChkCode); ec.OnError += new Leey.Net.eTerm.Net.ErrorHandler(ec_OnError); //ec.LocalIP = "10.108.16.20"; //连续执行指令之间的间隔。 对于新申请的航信配置可适当设置此参数,避免指令执行过快出现 Transation in process 错误。 ec.ExeInterval = 1000; //实现REMOTING HttpServerChannel channel = new HttpServerChannel(8081); ChannelServices.RegisterChannel(channel,false); RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyRemotableObject), "HelloWorld.rem", WellKnownObjectMode.Singleton); RemotableObjects.Cache.Attach(this); //启动日志记录 LogManager.Instance.LoadConfiguration(); LogManager.Instance.Log.Info("应用程序启动"); }
public frmMain() { InitializeComponent(); this.StartPosition = FormStartPosition.CenterScreen; //此处请设置为从代理商处取得的激活码 Leey.Net.eTerm.LicenseManager.Instance.Key = "ceshiceshiceshi"; ec = new EtermConnection(); ec.OnReadPacket += new EtermConnection.CmdResultHandler(ec_OnReadPacket); ec.OnSendPacket += new EtermConnection.PacketHandler(ec_OnSendPacket); ec.OnLogin += new Leey.Net.eTerm.Net.ObjectHandler(ec_OnLogin); ec.OnUnLogin += new Leey.Net.eTerm.Net.ObjectHandler(ec_OnUnLogin); ec.OnEtermConnectionStateChanged += new EtermConnection.EtermConnectionStateHandler(ec_OnEtermConnectionStateChanged); ec.OnGetChkCode += new EtermConnection.ChkCodeHandler(ec_OnGetChkCode); ec.OnError += new Leey.Net.eTerm.Net.ErrorHandler(ec_OnError); //ec.LocalIP = "10.108.16.20"; //连续执行指令之间的间隔。 对于新申请的航信配置可适当设置此参数,避免指令执行过快出现 Transation in process 错误。 ec.ExeInterval = 1000; //实现REMOTING HttpServerChannel channel = new HttpServerChannel(8081); ChannelServices.RegisterChannel(channel, false); RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyRemotableObject), "HelloWorld.rem", WellKnownObjectMode.Singleton); RemotableObjects.Cache.Attach(this); //启动日志记录 LogManager.Instance.LoadConfiguration(); LogManager.Instance.Log.Info("应用程序启动"); }
public frmRegistor(EtermConnection ec, Image i) { InitializeComponent(); this.ec = ec; this.i = i; this.pictureBox1.Image = i; }