当前位置:首页 > 网络编程 > WEB编程 > ASP.net > 一个简单的.net remoting客户端例子

一个简单的.net remoting客户端例子

点击次数:19 次 发布日期:2008-11-27 01:40:13 作者:源代码网
源代码网推荐

一个简单的.net remoting客户端例子
public static void Main()
{
      RemotingConfiguration.Configure("Client.exe.config");
      RemotableType type1 = new RemotableType();
      type1.StringMethod();
}
对应的IL为:
.method public hidebysig static void Main() cil managed
{
      .entrypoint
      // Code Size: 24 byte(s)
      .maxstack 1
      .locals (
            [RemotableType]RemotableType type1)
      L_0000: ldstr "Client.exe.config"
      L_0005: call void [mscorlib]System.Runtime.Remoting.
RemotingConfiguration::Configure(string)
      L_000a: newobj instance void [RemotableType]RemotableType::.ctor()
      L_000f: stloc.0 
      L_0010: ldloc.0 
      L_0011: callvirt instance string [RemotableType]RemotableType::StringMethod()
      L_0016: pop 
      L_0017: ret 
}
newobj将会调用ActivationServices.IsCurrentContextOK()
callvirt将会调用RealProxy.PrivateInvoke()


源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华