0

This is what I currently have

    using (WebClient client = new WebClient()) {
        WebProxy proxy = new WebProxy();
        //proxy.Address = new Uri("http://" + proxyIP.Text + ":" + proxyPort.Text);
        //proxy.Credentials = new NetworkCredential(proxyUsername.Text, proxyPassword.Text);
        proxy.Address = new Uri("http://" + "96.44.147.138" + ":" + "6060");
        proxy.Credentials = new NetworkCredential(proxyUsername.Text, proxyPassword.Text);
        proxy.UseDefaultCredentials = false;
        proxy.BypassProxyOnLocal = false;
        client.Proxy = proxy;
        Console.WriteLine(client.DownloadString("http://bot.whatismyipaddress.com/"));
    }

The issue is that, I still get an error saying

Additional information: The remote server returned an error: (407) Proxy Authentication Required.

Even though the information is correct.

Any ideas?

My question is not solved through the other thread because this question involves using and the I'm doing it in winform.

Dgameman1
  • 378
  • 5
  • 24
  • 2
    Check if this helps, http://stackoverflow.com/questions/2581609/the-remote-server-returned-an-error-407-proxy-authentication-required – Arun Selva Kumar Aug 22 '16 at 07:35
  • @ArunSelvaKumar I do not believe it's related? I could 100% wrong. This is in winforms – Dgameman1 Aug 22 '16 at 07:39
  • You are still using system.net to make the call to the other server. You could try putting the config setting proposed in the other question in your app.config file. – Martin Brown Aug 22 '16 at 08:15
  • @MartinBrown Umm... Where would my app.config file be? – Dgameman1 Aug 22 '16 at 08:33
  • Put it in the same location as your project file. Add it to your project and call it app.config. See http://stackoverflow.com/a/13043569/20553 – Martin Brown Aug 22 '16 at 10:00
  • @MartinBrown I'm honestly retarded. I looked for a solid amount on it online and I can't figure it out =/ It's a winforms project – Dgameman1 Aug 23 '16 at 07:18

0 Answers0