Error 407 when connecting in proxy

Asked

Viewed 149 times

0

I am trying to communicate with a web service and my machine uses internet via proxy. When initiating web service communication, proxy authentication error. How can I get the user and password I use for browser? I’m using visual studio 2010 and C#.

  • 1

    Post the code, so you can help.

  • I was able to solve it with the following code: Webproxy proxy = new Webproxy(); Uri myUri = new Uri("urlproxy:port"); proxy. Address = myUri; Networkcredential crediciais = new Networkcredential("user", "password"); proxy.Credentials = crediciais; objectWebService.Proxy = proxy;

  • You can answer your own question.

  • It is possible to use the default user and password by adding the following code in the app.config <Configuration> <system.net> <defaultProxy enabled="true" useDefaultCredentials="true"> </defaultProxy> </system.net> </Configuration>

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.