[Serializable] |
The WebProxy class is the base implementation of the IWebProxy interface.
WebProxy proxyObject = new WebProxy("http://proxyserver:80/",true); WebRequest req = WebRequest.Create("http://www.contoso.com"); req.Proxy = proxyObject;
ctor #1 | Overloaded:.ctor() Default constructor. This constructor is called by derived class constructors to initialize state in this type.Initializes an empty instance of the WebProxy class. |
ctor #2 | Overloaded:.ctor(string Address) Initializes a new instance of the WebProxy class with the specified URI. |
ctor #3 | Overloaded:.ctor(Uri Address) Initializes a new instance of the WebProxy class from the specified Uri. |
ctor #5 | Overloaded:.ctor(string Address, bool BypassOnLocal) Initializes a new instance of the WebProxy class with the specified URI and bypass setting. |
ctor #6 | Overloaded:.ctor(string Host, int Port) Initializes a new instance of the WebProxy class with the specified host and port number. |
ctor #7 | Overloaded:.ctor(Uri Address, bool BypassOnLocal) Initializes a new instance of the WebProxy class with the Uri and bypass setting. |
ctor #8 | Overloaded:.ctor(string Address, bool BypassOnLocal, string[] BypassList) Initializes a new instance of the WebProxy class with the specified URI, bypass setting, and list of URIs to bypass. |
ctor #9 | Overloaded:.ctor(Uri Address, bool BypassOnLocal, string[] BypassList) Initializes a new instance of the WebProxy class with the specified Uri, bypass setting, and list of URIs to bypass. |
ctor #10 | Overloaded:.ctor(string Address, bool BypassOnLocal, string[] BypassList, ICredentials Credentials) Initializes a new instance of the WebProxy class with the specified URI, bypass setting, list of URIs to bypass, and credentials. |
ctor #11 | Overloaded:.ctor(Uri Address, bool BypassOnLocal, string[] BypassList, ICredentials Credentials) Initializes a new instance of the WebProxy class with the specified Uri, bypass setting, list of URIs to bypass, and credentials. |
Address | Read-write Gets or sets the address of the proxy server. |
BypassArrayList | Read-only Gets a list of addresses that do not use the proxy server. |
BypassList | Read-write Gets or sets an array of addresses that do not use the proxy server. |
BypassProxyOnLocal | Read-write Gets or sets a value indicating whether to bypass the proxy server for local addresses. |
Credentials | Read-write Gets or sets the credentials to submit to the proxy server for authentication. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
GetDefaultProxy | Reads the Internet Explorer nondynamic proxy settings. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetProxy | Returns the proxied URI for a request. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
IsBypassed | Indicates whether to use the proxy server for the specified host. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
ctor #4 | Overloaded:.ctor(SerializationInfo serializationInfo, StreamingContext streamingContext) Supports the Shared Source CLI infrastructure and is not intended to be used directly from your code |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public WebProxy(); |
When the WebProxy.Address property is null, the WebProxy.IsBypassed method returns true, and the WebProxy.GetProxy method returns the destination address.
public WebProxy( |
Address
Exception Type | Condition |
---|---|
UriFormatException | Address is an invalid URI. |
public WebProxy( |
Address
protected WebProxy( |
serializationInfo
streamingContext
Address
BypassOnLocal
Exception Type | Condition |
---|---|
UriFormatException | Address is an invalid URI. |
Host
Port
Exception Type | Condition |
---|---|
UriFormatException | The URI formed by combining Host and Port is not a valid URI. |
Address
BypassOnLocal
Address
BypassOnLocal
BypassList
Exception Type | Condition |
---|---|
UriFormatException | Address is an invalid URI. |
Address
BypassOnLocal
BypassList
public WebProxy( |
Address
BypassOnLocal
BypassList
Credentials
Exception Type | Condition |
---|---|
UriFormatException | Address is an invalid URI. |
public WebProxy( |
Address
BypassOnLocal
BypassList
Credentials
public Uri Address {get; set;}
|
public ArrayList BypassArrayList {get;}
|
public string[] BypassList {get; set;}
|
public bool BypassProxyOnLocal {get; set;}
|
If WebProxy.BypassProxyOnLocal is true, requests to local Internet resources do not use the proxy server. Local requests are identified by the lack of a period (.) in the URI, as in http://webserver/ or access the local server, including http://localhost, http://loopback, or http://127.0.0.1 . When WebProxy.BypassProxyOnLocal is false, all Internet requests are made through the proxy server.
public ICredentials Credentials {get; set;}
|
~WebProxy(); |
public static WebProxy GetDefaultProxy(); |
The WebProxy.GetDefaultProxy does not pick up any dynamic settings that are generated from script run by Internet Explorer, from automatic configuration entries, or from DHCP or DNS lookups.
public virtual int GetHashCode(); |
destination
WebProxy.GetProxy compares destination with the contents of WebProxy.BypassList using the WebProxy.IsBypassed method. If WebProxy.IsBypassed returns true, WebProxy.GetProxy returns destination and the WebRequest does not use the proxy server.
If destination is not in WebProxy.BypassList, the WebRequest uses the proxy server, and the WebProxy.Address property is returned.
public Type GetType(); |
host
The WebProxy.BypassProxyOnLocal and WebProxy.BypassList properties control the return value of the WebProxy.IsBypassed method.
WebProxy.IsBypassed returns true under any of the following conditions.
All other conditions return false.
protected object MemberwiseClone(); |
public virtual string ToString(); |