GlobalProxySelection GlobalProxySelection GlobalProxySelection GlobalProxySelection Class

Definition

Warning

This API is now obsolete.

Contains a global default proxy instance for all HTTP requests.

public ref class GlobalProxySelection
[System.Obsolete("This class has been deprecated. Please use WebRequest.DefaultWebProxy instead to access and set the global default proxy. Use 'null' instead of GetEmptyWebProxy. http://go.microsoft.com/fwlink/?linkid=14202")]
[System.Obsolete("This class has been deprecated. Please use WebRequest.DefaultWebProxy instead to access and set the global default proxy. Use 'null' instead of GetEmptyWebProxy. https://go.microsoft.com/fwlink/?linkid=14202")]
public class GlobalProxySelection
type GlobalProxySelection = class
Public Class GlobalProxySelection
Inheritance
GlobalProxySelectionGlobalProxySelectionGlobalProxySelectionGlobalProxySelection
Attributes

Examples

The following code example sets the GlobalProxySelection for an HTTP proxy named "webproxy" on port 80.

Uri^ proxyURI = gcnew Uri( "http://webproxy:80" );
GlobalProxySelection::Select = gcnew WebProxy( proxyURI );
Uri proxyURI = new Uri("http://webproxy:80");
GlobalProxySelection.Select = new WebProxy(proxyURI);
Dim proxyURI As New Uri("http://webproxy:80")
GlobalProxySelection.Select = New WebProxy(proxyURI)

Remarks

The GlobalProxySelection stores the proxy settings for the default proxy that WebRequest instances use to contact Internet sites beyond the local network. The default proxy setting is initialized from the global or application configuration file, and can be overridden for individual requests or disabled by setting the HttpWebRequest.Proxy property to the result of the GetEmptyWebProxy method.

The proxy settings stored in GlobalProxySelection are used by any WebRequest derived objects that support proxies and have their Proxy property value set to null (the default). Proxies are currently supported by FtpWebRequest, HttpWebRequest, and WebClient.

Note Changes to the GlobalProxySelection after a request is made are not reflected in a WebRequest.

Constructors

GlobalProxySelection() GlobalProxySelection() GlobalProxySelection() GlobalProxySelection()

Initializes a new instance of the GlobalProxySelection class.

Properties

Select Select Select Select

Gets or sets the global HTTP proxy.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEmptyWebProxy() GetEmptyWebProxy() GetEmptyWebProxy() GetEmptyWebProxy()

Returns an empty proxy instance.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also