C# WebClient and WebProxy example code.
by The Uni-Hacker on Aug.28, 2008, under Programming
The following is example source code written in C# on how to establish a web site connection using the WebClient object and the WebProxy object.
WebProxy p = null;
ICredentials cred;
cred = new NetworkCredential("username", "password");
p = new WebProxy("proxy.server.com:port", true, null, cred);
WebRequest.DefaultWebProxy = p;
WebClient wc = new WebClient();
wc.Proxy = p;
string data = wc.DownloadString(url);
September 7th, 2008 on 4:56 pm
How do I use the proxy reading the default properties from the IE ?
September 7th, 2008 on 4:56 pm
How do I use the proxy reading the default properties from the IE ?
September 7th, 2008 on 9:24 pm
None, the WebClient class uses the proxy settings from IE by default, and yes I actually tested this.