Pregunta

I have a C# Winforms application in vs 2012. There is a web client function in my application. I already purchase a private proxy for this application.

But it needs to get credentials before using the private proxy address. How to pass the credentials to the webclient functions?

¿Fue útil?

Solución

Just assign "Proxy" property and it's Credentials property:

var Client = new WebClient();
Client.Proxy = new WebProxy("31.4.5.26", 8080); // proxy's host,port
Client.Proxy.Credentials = new NetworkCredential("proxyuser","proxypassword");
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top