WebProxy Konstruktoren

Definition

Initialisiert eine neue Instanz der WebProxy-Klasse.

Überlädt

WebProxy()

Initialisiert eine leere Instanz der WebProxy-Klasse.

WebProxy(String, Boolean, String[], ICredentials)

Initialisiert eine neue Instanz der WebProxy-Klasse mit dem angegebenen URI, der angegebenen Umgehungseinstellung, der Liste der zu umgehenden URIs und den Anmeldeinformationen.

WebProxy(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.

WebProxy(String, Boolean, String[])

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

WebProxy(Uri, Boolean)

Initialisiert eine neue Instanz der WebProxy-Klasse mit der Uri-Instanz und der Umgehungseinstellung.

WebProxy(Uri, Boolean, String[], ICredentials)

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

WebProxy(String, Boolean)

Initialisiert eine neue Instanz der WebProxy-Klasse mit dem angegebenen URI und der angegebenen Umgehungseinstellung.

WebProxy(SerializationInfo, StreamingContext)
Veraltet.

Initialisiert unter Verwendung zuvor serialisierten Inhalts eine Instanz der WebProxy-Klasse.

WebProxy(Uri)

Initialisiert eine neue Instanz der WebProxy-Klasse mit der angegebenen Uri-Instanz.

WebProxy(String)

Initialisiert eine neue Instanz der WebProxy-Klasse mit dem angegebenen URI.

WebProxy(String, Int32)

Initialisiert eine neue Instanz der WebProxy-Klasse mit den Angaben für Host und Anschlussnummer.

WebProxy()

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

Initialisiert eine leere Instanz der WebProxy-Klasse.

public:
 WebProxy();
public WebProxy ();
Public Sub New ()

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

WebProxy^ CreateProxy()
{
   return gcnew WebProxy;
}
public static WebProxy CreateProxy()
{
    return new WebProxy();
}

Hinweise

Der parameterlose Konstruktor initialisiert eine leere instance der WebProxy -Klasse, wobei die Address -Eigenschaft auf festgelegt istnull.

Wenn die Address -Eigenschaft lautet, gibt nulldie IsBypassed -Methode und true die GetProxy -Methode die Zieladresse zurück.

Gilt für:

WebProxy(String, Boolean, String[], ICredentials)

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

Initialisiert eine neue Instanz der WebProxy-Klasse mit dem angegebenen URI, der angegebenen Umgehungseinstellung, der Liste der zu umgehenden URIs und den Anmeldeinformationen.

public:
 WebProxy(System::String ^ Address, bool BypassOnLocal, cli::array <System::String ^> ^ BypassList, System::Net::ICredentials ^ Credentials);
public WebProxy (string? Address, bool BypassOnLocal, string[]? BypassList, System.Net.ICredentials? Credentials);
public WebProxy (string Address, bool BypassOnLocal, string[] BypassList, System.Net.ICredentials Credentials);
new System.Net.WebProxy : string * bool * string[] * System.Net.ICredentials -> System.Net.WebProxy
Public Sub New (Address As String, BypassOnLocal As Boolean, BypassList As String(), Credentials As ICredentials)

Parameter

Address
String

Der URI des Proxyservers.

BypassOnLocal
Boolean

true, um den Proxy bei lokalen Adressen zu umgehen, andernfalls false.

BypassList
String[]

Ein Array von Zeichenfolgen regulärer Ausdrücke mit den URIs der zu umgehenden Server.

Credentials
ICredentials

Eine für die Authentifizierung an den Proxyserver zu sendende ICredentials-Instanz.

Ausnahmen

Address ist ein ungültiger URI.

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

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

Hinweise

Die WebProxy instance wird initialisiert, wobei die Address -Eigenschaft auf einen Uri instance festgelegt ist, Addressder enthält, die BypassProxyOnLocal -Eigenschaft auf BypassOnLocalfestgelegt ist, die BypassList -Eigenschaft auf festgelegt ist und die Credentials -Eigenschaft auf BypassListCredentialsfestgelegt ist.

Weitere Informationen

Gilt für:

WebProxy(Uri, Boolean, String[])

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

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

public:
 WebProxy(Uri ^ Address, bool BypassOnLocal, cli::array <System::String ^> ^ BypassList);
public WebProxy (Uri? Address, bool BypassOnLocal, string[]? BypassList);
public WebProxy (Uri Address, bool BypassOnLocal, string[] BypassList);
new System.Net.WebProxy : Uri * bool * string[] -> System.Net.WebProxy
Public Sub New (Address As Uri, BypassOnLocal As Boolean, BypassList As String())

Parameter

Address
Uri

Eine Uri-Instanz mit der Adresse des Proxyservers.

BypassOnLocal
Boolean

true, um den Proxy bei lokalen Adressen zu umgehen, andernfalls false.

BypassList
String[]

Ein Array von Zeichenfolgen regulärer Ausdrücke mit den URIs der zu umgehenden Server.

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

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(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);
}

Hinweise

Die WebProxy instance wird initialisiert, wobei die Address -Eigenschaft auf Addressfestgelegt ist, die BypassProxyOnLocal -Eigenschaft auf BypassOnLocalfestgelegt ist, und die BypassList -Eigenschaft auf BypassListfestgelegt ist.

Gilt für:

WebProxy(String, Boolean, String[])

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

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

public:
 WebProxy(System::String ^ Address, bool BypassOnLocal, cli::array <System::String ^> ^ BypassList);
public WebProxy (string? Address, bool BypassOnLocal, string[]? BypassList);
public WebProxy (string Address, bool BypassOnLocal, string[] BypassList);
new System.Net.WebProxy : string * bool * string[] -> System.Net.WebProxy
Public Sub New (Address As String, BypassOnLocal As Boolean, BypassList As String())

Parameter

Address
String

Der URI des Proxyservers.

BypassOnLocal
Boolean

true, um den Proxy bei lokalen Adressen zu umgehen, andernfalls false.

BypassList
String[]

Ein Array von Zeichenfolgen regulärer Ausdrücke mit den URIs der zu umgehenden Server.

Ausnahmen

Address ist ein ungültiger URI.

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

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

Hinweise

Die WebProxy instance wird initialisiert, wobei die Address -Eigenschaft auf eine Uri instance festgelegt ist, Addressdie enthält, die BypassProxyOnLocal -Eigenschaft auf BypassOnLocalfestgelegt ist und die BypassList -Eigenschaft auf BypassListfestgelegt ist.

Weitere Informationen

Gilt für:

WebProxy(Uri, Boolean)

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

Initialisiert eine neue Instanz der WebProxy-Klasse mit der Uri-Instanz und der Umgehungseinstellung.

public:
 WebProxy(Uri ^ Address, bool BypassOnLocal);
public WebProxy (Uri? Address, bool BypassOnLocal);
public WebProxy (Uri Address, bool BypassOnLocal);
new System.Net.WebProxy : Uri * bool -> System.Net.WebProxy
Public Sub New (Address As Uri, BypassOnLocal As Boolean)

Parameter

Address
Uri

Eine Uri-Instanz mit der Adresse des Proxyservers.

BypassOnLocal
Boolean

true, um den Proxy bei lokalen Adressen zu umgehen, andernfalls false.

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

WebProxy^ CreateProxyWithExampleAddress( bool bypassLocal )
{
   return gcnew WebProxy( gcnew Uri( "http://contoso" ), bypassLocal );
}
public static WebProxy CreateProxyWithExampleAddress(bool bypassLocal)
{
    return new WebProxy(new Uri("http://contoso"), bypassLocal);
}

Hinweise

Der WebProxy instance wird initialisiert, wobei die Address -Eigenschaft auf Address festgelegt ist und die BypassProxyOnLocal -Eigenschaft auf BypassOnLocalfestgelegt ist.

Gilt für:

WebProxy(Uri, Boolean, String[], ICredentials)

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

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

public:
 WebProxy(Uri ^ Address, bool BypassOnLocal, cli::array <System::String ^> ^ BypassList, System::Net::ICredentials ^ Credentials);
public WebProxy (Uri? Address, bool BypassOnLocal, string[]? BypassList, System.Net.ICredentials? Credentials);
public WebProxy (Uri Address, bool BypassOnLocal, string[] BypassList, System.Net.ICredentials Credentials);
new System.Net.WebProxy : Uri * bool * string[] * System.Net.ICredentials -> System.Net.WebProxy
Public Sub New (Address As Uri, BypassOnLocal As Boolean, BypassList As String(), Credentials As ICredentials)

Parameter

Address
Uri

Eine Uri-Instanz mit der Adresse des Proxyservers.

BypassOnLocal
Boolean

true, um den Proxy bei lokalen Adressen zu umgehen, andernfalls false.

BypassList
String[]

Ein Array von Zeichenfolgen regulärer Ausdrücke mit den URIs der zu umgehenden Server.

Credentials
ICredentials

Eine für die Authentifizierung an den Proxyserver zu sendende ICredentials-Instanz.

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

WebProxy^ CreateProxyWithCredentials2( 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,
      CredentialCache::DefaultCredentials );
}
public static WebProxy CreateProxyWithCredentials2(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,
        CredentialCache.DefaultCredentials);
}

Hinweise

Die WebProxy instance wird initialisiert, wobei die Address -Eigenschaft auf Addressfestgelegt ist, die BypassProxyOnLocal -Eigenschaft auf BypassOnLocalfestgelegt ist, die BypassList -Eigenschaft auf BypassListfestgelegt ist und die Credentials -Eigenschaft auf Credentialsfestgelegt ist.

Gilt für:

WebProxy(String, Boolean)

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

Initialisiert eine neue Instanz der WebProxy-Klasse mit dem angegebenen URI und der angegebenen Umgehungseinstellung.

public:
 WebProxy(System::String ^ Address, bool BypassOnLocal);
public WebProxy (string? Address, bool BypassOnLocal);
public WebProxy (string Address, bool BypassOnLocal);
new System.Net.WebProxy : string * bool -> System.Net.WebProxy
Public Sub New (Address As String, BypassOnLocal As Boolean)

Parameter

Address
String

Der URI des Proxyservers.

BypassOnLocal
Boolean

true, um den Proxy bei lokalen Adressen zu umgehen, andernfalls false.

Ausnahmen

Address ist ein ungültiger URI.

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

WebProxy^ CreateProxyWithHostAddress( bool bypassLocal )
{
   WebProxy^ proxy = gcnew WebProxy( "http://contoso",bypassLocal );
   Console::WriteLine( "Bypass proxy for local URIs?: {0}", 
      proxy->BypassProxyOnLocal );
   return proxy;
}
public static WebProxy CreateProxyWithHostAddress(bool bypassLocal)
{
    WebProxy proxy =  new WebProxy("http://contoso", bypassLocal);
    Console.WriteLine("Bypass proxy for local URIs?: {0}",
       proxy.BypassProxyOnLocal);
    return proxy;
}

Hinweise

Die WebProxy instance wird initialisiert, wobei die Address -Eigenschaft auf eine Uri instance festgelegt ist, die enthältAddress, und die BypassProxyOnLocal -Eigenschaft auf BypassOnLocalfestgelegt ist.

Weitere Informationen

Gilt für:

WebProxy(SerializationInfo, StreamingContext)

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

Achtung

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initialisiert unter Verwendung zuvor serialisierten Inhalts eine Instanz der WebProxy-Klasse.

protected:
 WebProxy(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected WebProxy (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected WebProxy (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new System.Net.WebProxy : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.WebProxy
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Net.WebProxy : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.WebProxy
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

Parameter

serializationInfo
SerializationInfo

Die Serialisierungsdaten.

streamingContext
StreamingContext

Der Kontext für die serialisierten Daten.

Attribute

Hinweise

Diese Methode wird vom System aufgerufen, um eine WebProxy instance zu deserialisieren. Anwendungen rufen sie nicht auf.

Gilt für:

WebProxy(Uri)

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

Initialisiert eine neue Instanz der WebProxy-Klasse mit der angegebenen Uri-Instanz.

public:
 WebProxy(Uri ^ Address);
public WebProxy (Uri? Address);
public WebProxy (Uri Address);
new System.Net.WebProxy : Uri -> System.Net.WebProxy
Public Sub New (Address As Uri)

Parameter

Address
Uri

Eine Uri-Instanz mit der Adresse des Proxyservers.

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

WebProxy^ CreateProxyWithExampleAddress()
{
   return gcnew WebProxy( gcnew Uri( "http://contoso" ) );
}
public static WebProxy CreateProxyWithExampleAddress()
{
    return new WebProxy(new Uri("http://contoso"));
}

Hinweise

Die WebProxy instance wird initialisiert, wobei die Address Eigenschaft auf den Address Parameter festgelegt ist.

Gilt für:

WebProxy(String)

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

Initialisiert eine neue Instanz der WebProxy-Klasse mit dem angegebenen URI.

public:
 WebProxy(System::String ^ Address);
public WebProxy (string? Address);
public WebProxy (string Address);
new System.Net.WebProxy : string -> System.Net.WebProxy
Public Sub New (Address As String)

Parameter

Address
String

Der URI des Proxyservers.

Ausnahmen

Address ist ein ungültiger URI.

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

WebProxy^ CreateProxyWithHost()
{
   return gcnew WebProxy( "http://contoso" );
}
public static WebProxy CreateProxyWithHost()
{
    return new WebProxy("http://contoso");
}

Hinweise

Die WebProxy instance wird initialisiert, wobei die Address -Eigenschaft auf eine Uri instance festgelegt ist, die enthältAddress.

Gilt für:

WebProxy(String, Int32)

Quelle:
WebProxy.cs
Quelle:
WebProxy.cs
Quelle:
WebProxy.cs

Initialisiert eine neue Instanz der WebProxy-Klasse mit den Angaben für Host und Anschlussnummer.

public:
 WebProxy(System::String ^ Host, int Port);
public WebProxy (string Host, int Port);
new System.Net.WebProxy : string * int -> System.Net.WebProxy
Public Sub New (Host As String, Port As Integer)

Parameter

Host
String

Der Name des Proxyhosts.

Port
Int32

Die auf Host zu verwendende Anschlussnummer.

Ausnahmen

Der durch Kombination von Host und Port erstellte URI ist nicht gültig.

Beispiele

Im folgenden Codebeispiel wird das Aufrufen dieses Konstruktors veranschaulicht.

WebProxy^ CreateProxyWithHostAndPort()
{
   return gcnew WebProxy( "contoso",80 );
}
public static WebProxy CreateProxyWithHostAndPort()
{
    return new WebProxy("contoso", 80);
}

Hinweise

Der WebProxy instance wird initialisiert, wobei die Address -Eigenschaft auf eine Uri instance des Formulars http:// Host festgelegt ist: Port.

Gilt für: