Bewerken

Share via


WebRequest.DefaultWebProxy Property

Definition

Gets or sets the global HTTP proxy.

public:
 static property System::Net::IWebProxy ^ DefaultWebProxy { System::Net::IWebProxy ^ get(); void set(System::Net::IWebProxy ^ value); };
public static System.Net.IWebProxy DefaultWebProxy { get; set; }
public static System.Net.IWebProxy? DefaultWebProxy { get; set; }
static member DefaultWebProxy : System.Net.IWebProxy with get, set
Public Shared Property DefaultWebProxy As IWebProxy

Property Value

An IWebProxy used by every call to instances of WebRequest.

Remarks

Caution

WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete, and you shouldn't use them for new development. Use HttpClient instead.

The DefaultWebProxy property gets or sets the global proxy. The DefaultWebProxy property determines the default proxy that all WebRequest instances use if the request supports proxies and no proxy is set explicitly using the Proxy property. Proxies are currently supported by FtpWebRequest and HttpWebRequest.

The DefaultWebProxy property reads proxy settings from the app.config file. If there is no config file, the current user's Internet options proxy settings are used.

If the DefaultWebProxy property is set to null, all subsequent instances of the WebRequest class created by the Create or CreateDefault methods do not have a proxy.

Applies to