Freigeben über


WebProxy-Konstruktor (Uri, Boolean, String )

Initialisiert eine neue Instanz der WebProxy-Klasse mit der angegebenen Uri-Instanz, der angegebenen Umgehungseinstellung und der Liste der zu umgehenden URIs.

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

Syntax

'Declaration
Public Sub New ( _
    Address As Uri, _
    BypassOnLocal As Boolean, _
    BypassList As String() _
)
'Usage
Dim Address As Uri
Dim BypassOnLocal As Boolean
Dim BypassList As String()

Dim instance As New WebProxy(Address, BypassOnLocal, BypassList)
public WebProxy (
    Uri Address,
    bool BypassOnLocal,
    string[] BypassList
)
public:
WebProxy (
    Uri^ Address, 
    bool BypassOnLocal, 
    array<String^>^ BypassList
)
public WebProxy (
    Uri Address, 
    boolean BypassOnLocal, 
    String[] BypassList
)
public function WebProxy (
    Address : Uri, 
    BypassOnLocal : boolean, 
    BypassList : String[]
)

Parameter

  • Address
    Eine Uri-Instanz mit der Adresse des Proxyservers.
  • BypassOnLocal
    true, um den Proxy bei lokalen Adressen zu umgehen, andernfalls false.
  • BypassList
    Ein Array von Zeichenfolgen regulärer Ausdrücke mit den URIs der zu umgehenden Server.

Hinweise

Beim Initialisieren der WebProxy-Instanz wird die Address-Eigenschaft auf Address, die BypassProxyOnLocal-Eigenschaft auf BypassOnLocal und die BypassList-Eigenschaft auf BypassList festgelegt.

Beispiel

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

public static WebProxy CreateProxyWithBypassList(bool bypassLocal)
{
    // Do not use the proxy server for Contoso.com URIs.
    string[] bypassList = new string[]{";*.Contoso.com"};
    return new WebProxy(new Uri("http://contoso"), 
        bypassLocal, 
        bypassList);
}
WebProxy^ CreateProxyWithBypassList( bool bypassLocal )
{
   // Do not use the proxy server for Contoso.com URIs.
   array<String^>^ bypassList = {";*.Contoso.com"};
   return gcnew WebProxy( gcnew Uri( "http://contoso" ),
      bypassLocal,
      bypassList );
}
public static WebProxy CreateProxyWithBypassList(boolean bypassLocal)
{
    // Do not use the proxy server for Contoso.com URIs.
    String bypassList[] = new String[] { ";*.Contoso.com" };
    return new WebProxy(new Uri("http://contoso"), bypassLocal, bypassList);
} //CreateProxyWithBypassList

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

WebProxy-Klasse
WebProxy-Member
System.Net-Namespace