質問

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?

役に立ちましたか?

解決

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");
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top