如何获得RealProxy时,我只知道透明代理 [英] How to get the RealProxy when I know only the transparent proxy

查看:234
本文介绍了如何获得RealProxy时,我只知道透明代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个透明代理,比如一个接WCF生成的:

I have a transparent proxy, for instance one generated by WCF:

        ChannelFactory<ICalculator> channelFactory = 
            new ChannelFactory<ICalculator>(
              new NetNamedPipeBinding(),
              "net.pipe://localhost/WcfTransparentProxy/Calculator" );
        ICalculator calculator = channelFactory.CreateChannel();

我如何从透明代理获得RealProxy?

How do I get the RealProxy from the transparent proxy?

推荐答案

有一个在RemotingServices功能专门针对这样的:

There's a function in RemotingServices specifically for this:

System.Runtime.Remoting.RemotingServices.GetRealProxy(transparentProxy);

这篇关于如何获得RealProxy时,我只知道透明代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆