当前位置: 首页 > news >正文

江西医疗网站备案前置审批每月网站流量

江西医疗网站备案前置审批,每月网站流量,河北移动端网站建设,软件工程主要课程今天研究了下MarshalByRefObject跨程序通讯#xff0c;由于今天很晚了#xff0c;先贴出DOME代码。 分别建立2个winform程序#xff0c;WinClient和WinServer#xff0c;2个项目中都有CommunicationInfo类#xff08;你也可以将CommunicationInfo做成一个类库供2个winform…        今天研究了下MarshalByRefObject跨程序通讯由于今天很晚了先贴出DOME代码。      分别建立2个winform程序WinClient和WinServer2个项目中都有CommunicationInfo类你也可以将CommunicationInfo做成一个类库供2个winform程序引用。     贴上代码   CommunicationInfo.cs   CommunicationInfo .cs using System; using System.Collections.Generic; using System.Linq; using System.Text;public class CommunicationInfo : MarshalByRefObject{public CommunicationInfo(){}public override object InitializeLifetimeService(){//return base.InitializeLifetimeService();System.Runtime.Remoting.Lifetime.ILease aLease (System.Runtime.Remoting.Lifetime.ILease)base.InitializeLifetimeService();if (aLease.CurrentState System.Runtime.Remoting.Lifetime.LeaseState.Initial){// 不过期aLease.InitialLeaseTime TimeSpan.Zero;}return aLease;}public class CommunicationEventArg : EventArgs{public string Name string.Empty;}public delegate void JobAddEventHandler(CommunicationEventArg e);public event JobAddEventHandler OnJobAdd;public void CallJobAddEvent(string name){CommunicationEventArg ee new CommunicationEventArg();ee.Name name;OnJobAdd(ee);}} WinServer View Code //测试事件private void _communicationInfo_OnJobAdd(RemoteObject.CommunicationInfo.CommunicationEventArg e){textBox1.Text textBox1.Text \r\n e.Name;}RemoteObject.CommunicationInfo _communicationInfo null;private void button1_Click(object sender, EventArgs e){if (_communicationInfo null){System.Runtime.Remoting.Channels.Tcp.TcpServerChannel servChannel new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel(18089);System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(servChannel, true);_communicationInfo new RemoteObject.CommunicationInfo();_communicationInfo.OnJobAdd new RemoteObject.CommunicationInfo.JobAddEventHandler(_communicationInfo_OnJobAdd);System.Runtime.Remoting.RemotingServices.Marshal(_communicationInfo, message1,typeof(RemoteObject.CommunicationInfo));}} WinClient View Code RemoteObject.CommunicationInfo _communicationInfo;private void button1_Click(object sender, EventArgs e){if (_communicationInfo null){System.Runtime.Remoting.Channels.Tcp.TcpClientChannel _clientChannel;_clientChannel new System.Runtime.Remoting.Channels.Tcp.TcpClientChannel();System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(_clientChannel, true);_communicationInfo (RemoteObject.CommunicationInfo)System.Activator.GetObject(typeof(RemoteObject.CommunicationInfo), tcp://127.0.0.1:18089/message1, System.Runtime.Remoting.WellKnownObjectMode.Singleton);}_communicationInfo.CallJobAddEvent(DateTime.Now.ToString(yyyy-MM-dd HH:mm:ss fff));//启动事件 }  转载于:https://www.cnblogs.com/shunhe316/archive/2012/08/26/2657082.html
http://www.zqtcl.cn/news/35398/

相关文章:

  • 网站建设花多少钱西安知名网站开发的公司
  • 网站内链结构是什么怎么办
  • 无锡模板网站wordpress压缩图片
  • 国外企业招聘网站wordpress emoji表情
  • python 做网站我们是谁 网站运营
  • 企业百度网站怎么做中国移动手机支付网站
  • 成都网站建设推荐安徽秒搜科技相亲网站做期货现货贵金属的人
  • 嘉兴公司的网站设计网站不备案会怎...
  • 怎么制作钓鱼网站链接建设网站的相关技术指标
  • 模板手机网站建设公司排名如何制作手机免费网站模板下载
  • 广告网站定制企业网站只做英文
  • 网站关键字怎么做在线做原型的网站
  • 静态动漫网站模板企业网站的缺点
  • 个人网站开发工具品牌建设有待加强
  • 没有网站怎么做推广me域名公司网站
  • 扬州市住房和建设局网站网站 权限
  • 北京微信网站搭建多少钱工具网站有哪些
  • 做ppt的网站网站建站销售提成
  • 网站做好后怎么做seo广告推广策划方案
  • php网站建设案例教程视频专门做顶账房的网站
  • 网站主机服务器郴州网站优化
  • 李宁运动服网站建设规划书网站建设秋实
  • 聊城做网站推广网站推广优化网址
  • 网站开发树形图外网建筑设计网站
  • 秦皇岛做网站的公司宏杰zkeys网站模板
  • 做一个网站要注意什么哈尔滨公共资源交易网建设工程
  • 做网站别名解析的目的是什么wordpress管理后台添加导航栏
  • 北京网站设计与建设vue登录页面模板
  • 彩票开奖网站建设做一个网站的成本
  • 最新自助建站源码佛山市禅城网站建设