2010-08-20 8 views
3

J'ai un proxy transparent, par exemple celui généré par WCF:Comment obtenir le RealProxy quand je sais que le proxy transparent

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

Comment puis-je obtenir le RealProxy du proxy transparent?

Répondre

8

Il y a une fonction RemotingServices spécifiquement pour cela:

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

+0

Merci! C'est ce que je cherchais. –

+0

savez-vous comment je peux détecter le type de proxy en fournissant simplement l'IP, le port. Y at-il une classe pour cela dans .net – Smith