I have a console app built on .NET 4 that uses the HttpClient
library (obtained via NuGet) to retrieve data from a public API over the internet. The console app
If you wanted to do the same programmatically you could use the following:
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
(These objects are from the `System.Net' namespace).
Some more info from MSDN: http://msdn.microsoft.com/en-us/library/system.net.webproxy.getdefaultproxy.aspx