HttpWebRequest webexcepton:the remote server returned an error: (407) Proxy authentication Required.

Source: Internet
Author: User

1. Supply the credentials of the currently logged on User to the Proxy object similar to this:

Begin code Change by Jeff                     //  Obtain the ' Proxy ' of the  Default browser.                     IWebProxy theproxy = areq.proxy;                    Print the Proxy Url to the console.                    if (theproxy! = null)                    {//Use the default credentials of the logged on user                        . Theproxy.credentials = CredentialCache.DefaultCredentials;                    }                    End code change by Jeff                     HttpWebResponse Aresp = Areq.getresponse () as HttpWebResponse;

2. Add This property to the <<application>>.exe.config or machine.config file:

<system.net>    <defaultproxy usedefaultcredentials= "true" > </defaultProxy></system.net>

link:http://blogs.msdn.com/b/jpsanders/archive/2009/03/24/ Httpwebrequest-webexcepton-the-remote-server-returned-an-error-407-proxy-authentication-required.aspx

HttpWebRequest webexcepton:the remote server returned an error: (407) Proxy authentication Required.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.