0 out of 1 rated this helpful - Rate this topic

How to: Enable a WebRequest to Use a Proxy to Communicate With the Internet

This example creates a global proxy instance that will enable any WebRequest to use a proxy to communicate with the Internet. The example assumes that the proxy server is named webproxy and that it communicates on port 80, the standard HTTP port.

WebProxy proxyObject = new WebProxy("http://webproxy:80/");
GlobalProxySelection.Select = proxyObject;

This example requires:

  • References to the System.Net namespace.

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.