我像利用remoting在两个程序之间通信 比如Server.exe是个winform 要在Client.exe启动时获得通知 并且能向客户端发送指令 
是不是需要在两个程序中都Register一个WellKnown对象?互相调用方法?一般是怎样设计的?

解决方案 »

  1.   

    client.exe 启动时你调用server 端提供的方法,发送一个启动确认!.net remoting 会在server ,clent 端同时生成2个代理
      

  2.   

    3,标准的.Net Remoting Configuration配置文件 
    MSDN中有.Net Remoting Configuration file中全部元素/属性的完整的详细说明,需要的时候再查阅了。一般情况下,知道下面这些属性就够用了。<configuration><system.runtime.remoting>     <application>       <lifetime /> ―― 配置Remote Objects生存期的信息       <channels /> ―― 配置与远程对象进行通信的信道       <service />        <client />     </application></system.runtime.remoting></configuration>简单说明:(1)<service> ―― 仅在Server端配置     <service>         <wellknown /> ―― 配置要发布的SAO(已知)对象的信息         <activated /> ―― 配置要发布的CAO客户端激活对象的信息     </service>(2)<client> ―― 仅在Client端配置,与Server端<service>对应        <client>           <wellknown />          <activated />       </client>When using CAOs, the <client> property has to specify the URI to the server for all underlying <activated> entries.Note:When using CAOs from more than one server, you have to create several <client> properties in your configuration file.当调用CAO远程对象时,必须设定<client>的url属性。如果CAO来自不同的Server,则需要在配置文件中定义多个<client>。如下所示:    <client url="http://localhost/MyServer>       <activated type="Server.MyRemote, Client" />      </client>
      

  3.   

    to 1楼:我是想客户端启动的时候向服务端发送一个消息 然后服务端根据消息修改winform界面 然后客户端判断服务端的一个bool值 再决定是退出还是做其他的一些工作再退出然后在Server中RegisterWellKnownService以后 客户端用Activator.GetObject以后 服务端怎样查询被客户端操作的对象?
    能否给个简单的remoting的例子?