服务器端配置文件事件如下:
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="Singleton"
type="Inovout.Remoting.RemotingObject.Calcuator,RemotingObjectClassLibrary"
objectUri="Calculator.rem"/>
</service>
<channels>
<channel ref="tcp" port="8891"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>
客户端配置文件事例如下:
<configuration>
<system.runtime.remoting>
<system.runtime.remoting>
<application>
<client>
<wellknown
type="Inovout.Remoting.RemotingObject.Calcuator,RemotingObjectClassLibrary"
url="tcp://localhost:8891/Calculator.rem"
/>
</client>
<channels>
<channel
ref="tcp"/>
</channels>
</application>
</system.runtime.remoting>
</system.runtime.remoting>
</configuration>
注册方法事例代码如下:
// ClientWindowsApplication.exe.config为客户端或服务器端配置文件名。
RemotingConfiguration.Configure("ClientWindowsApplication.exe.config", true);
本文介绍如何利用配置文件来简化.NET Remoting的设置过程,包括服务器端和客户端的具体配置示例,并提供了配置文件的注册方法。

被折叠的 条评论
为什么被折叠?



