In one of my applications I’m using the WebClient class (from namespace System.Net) to download a file from the internet. The syntax is pretty easy:
var client : WebClient := new WebClient(); client.DownloadFile(src, dst);
With src and dst being strings. This worked always fine for me until recently after I’ve installed a proxy. To have WebClient automatically use your proxy-settings (e.g. taken from the Internet Explorer) simply add the following line after instantiating WebClient:
client.Proxy := new WebProxy;
To learn more about automatic proxy detection read on here.
Comments