.net教程:一个简单的.net remoting客户端例子
[size=3]一个简单的.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()
[/size]
页:
[1]