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

王朝c#·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

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()

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航