See Also: WebProxy Members
All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.
System.Net.WebRequest instances use System.Net.WebProxy instances to override the proxy settings in System.Net.GlobalProxySelection .
Note: Local requests are identified by the lack of a period (.) in the authority of the URI, as in "http://webserver/" versus "http://www.contoso.com/ ".
The following example sets a System.Net.WebProxy for a System.Net.WebRequest. The System.Net.WebRequest instance uses the proxy to connect to external Internet resources.
C# Example
using System; using System.Net; public class WebProxyExample { public static void Main() { WebProxy proxyObject = new WebProxy("http://proxyserver:80/",true); WebRequest req = WebRequest.Create("http://www.contoso.com"); req.Proxy = proxyObject; } }
Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.x.x, 1.0.5000.0, 2.0.0.0