Export (0) Print
Expand All

WebProxy.GetProxy Method

Returns the proxied URI for a request.

Namespace:  System.Net
Assembly:  System (in System.dll)

abstract GetProxy : 
        destination:Uri -> Uri  
override GetProxy : 
        destination:Uri -> Uri

Parameters

destination
Type: System.Uri

The Uri instance of the requested Internet resource.

Return Value

Type: System.Uri
The Uri instance of the Internet resource, if the resource is on the bypass list; otherwise, the Uri instance of the proxy.

Implements

IWebProxy.GetProxy(Uri)

ExceptionCondition
ArgumentNullException

The destination parameter is a null reference (Nothing in Visual Basic).

The GetProxy method returns the URI that the WebRequest instance uses to access the Internet resource.

GetProxy compares destination with the contents of BypassList, using the IsBypassed method. If IsBypassed returns true, GetProxy returns destination and the WebRequest instance does not use the proxy server.

If destination is not in BypassList, the WebRequest instance uses the proxy server and the Address property is returned.

The following code example creates a WebProxy object and calls this method to get the proxy that is selected for a resource.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft