Go homepage(回首页)
Upload pictures (上传图片)
Write articles (发文字帖)

The author:(作者)qq
published in(发表于) 2014/7/9 1:35:39
ASP.NET Remoting体系结构(三)

ASP.NET Remoting体系结构(三):RemotingConfiguration类

RemotingConfiguration类

由于像IP地址和端口号这样的信息在开发和实践中常需要改变,因此.NET Remoting 体系中设计了RemotingConfiguration类使得开发人员可以用它来读取XML格式的位置文件来配置远程处理基础结构。

RemotingConfiguration类最重要的是Configure()方法用它直接读取配制文件就可以设置许多.NET Remoting 的基础结构。

l 服务器端常用配置,代码如下:










mode="Singleton" //远程类对象激活方式

type="RemotableType, RemotableType" //远程类对象类名,远程类对象所在类库

objectUri="RemotableType.rem"//指定统一资源标识符的终结点

/>





//所选信道为http信道还是tcp信道,和侦听的端口号









l 客户端常用配置,代码如下:










type="RemotableType, RemotableType"//远程类对象类名,远程类对象所在类库

url="http://localhost:8989/RemotableType.rem"//将要连接的远程类的ip和端口号

/> //及objecturl









注意:上面的配置适合在本地计算机运行,如果在不同的计算机上测试,那么wellknown节点中的url属性应该指定相应的计算机IP地址,例如url="http://192.168.1.99:8989/ RemotableType.rem"。




If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)





QQ:154298438
QQ:417480759