WebProxy Constructors
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Initialiseert een nieuw exemplaar van de WebProxy klasse.
Overloads
| Name | Description |
|---|---|
| WebProxy() |
Initialiseert een leeg exemplaar van de WebProxy klasse. |
| WebProxy(String, Boolean, String[], ICredentials) |
Initialiseert een nieuw exemplaar van de WebProxy klasse met de opgegeven URI, bypass-instelling, lijst met URI's die moeten worden overgeslagen en referenties. |
| WebProxy(Uri, Boolean, String[]) |
Initialiseert een nieuw exemplaar van de WebProxy klasse met de opgegeven Uri instantie, bypass-instelling en lijst met URI's die moeten worden overgeslagen. |
| WebProxy(String, Boolean, String[]) |
Initialiseert een nieuw exemplaar van de WebProxy klasse met de opgegeven URI, bypass-instelling en lijst met URI's die moeten worden omzeild. |
| WebProxy(Uri, Boolean) |
Initialiseert een nieuw exemplaar van de WebProxy klasse met het Uri exemplaar en omzeilt de instelling. |
| WebProxy(Uri, Boolean, String[], ICredentials) |
Initialiseert een nieuw exemplaar van de WebProxy klasse met het opgegeven Uri exemplaar, bypass-instelling, lijst met URI's die moeten worden overgeslagen en referenties. |
| WebProxy(String, Boolean) |
Initialiseert een nieuw exemplaar van de WebProxy klasse met de opgegeven URI en bypass-instelling. |
| WebProxy(SerializationInfo, StreamingContext) |
Initialiseert een exemplaar van de WebProxy klasse met behulp van eerder geserialiseerde inhoud. |
| WebProxy(Uri) |
Initialiseert een nieuw exemplaar van de WebProxy klasse van het opgegeven Uri exemplaar. |
| WebProxy(String) |
Initialiseert een nieuw exemplaar van de WebProxy klasse met de opgegeven URI. |
| WebProxy(String, Int32) |
Initialiseert een nieuw exemplaar van de WebProxy klasse met het opgegeven host- en poortnummer. |
WebProxy()
Initialiseert een leeg exemplaar van de WebProxy klasse.
public:
WebProxy();
public WebProxy();
Public Sub New ()
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
public static WebProxy CreateProxy()
{
return new WebProxy();
}
Opmerkingen
De parameterloze constructor initialiseert een leeg exemplaar van de WebProxy klasse met de Address eigenschap ingesteld op null.
Wanneer de Address eigenschap isnull, retourneert true de IsBypassed methode en retourneert de GetProxy methode het doeladres.
Van toepassing op
WebProxy(String, Boolean, String[], ICredentials)
Initialiseert een nieuw exemplaar van de WebProxy klasse met de opgegeven URI, bypass-instelling, lijst met URI's die moeten worden overgeslagen en referenties.
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);
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)
Parameters
- Address
- String
De URI van de proxyserver.
- BypassOnLocal
- Boolean
true om de proxy voor lokale adressen te omzeilen; anders, false.
- BypassList
- String[]
Een matrix met tekenreeksen voor reguliere expressies die de URI's van de servers bevatten die moeten worden omzeild.
- Credentials
- ICredentials
Een ICredentials exemplaar dat moet worden verzonden naar de proxyserver voor verificatie.
Uitzonderingen
Address is een ongeldige URI.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
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);
}
Opmerkingen
Het WebProxy exemplaar wordt geïnitialiseerd met de Address eigenschap ingesteld op een Uri exemplaar dat de BypassProxyOnLocal eigenschap bevat Addressdie is ingesteld opBypassOnLocal, de BypassList eigenschap ingesteld BypassListop en de Credentials eigenschap ingesteld opCredentials.
Zie ook
Van toepassing op
WebProxy(Uri, Boolean, String[])
public:
WebProxy(Uri ^ Address, bool BypassOnLocal, cli::array <System::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())
Parameters
- BypassOnLocal
- Boolean
true om de proxy voor lokale adressen te omzeilen; anders, false.
- BypassList
- String[]
Een matrix met tekenreeksen voor reguliere expressies die de URI's van de servers bevatten die moeten worden omzeild.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
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);
}
Opmerkingen
Het WebProxy exemplaar wordt geïnitialiseerd met de Address eigenschap ingesteld op Address, de BypassProxyOnLocal eigenschap ingesteld op BypassOnLocalen de BypassList eigenschap ingesteld op BypassList.
Van toepassing op
WebProxy(String, Boolean, String[])
Initialiseert een nieuw exemplaar van de WebProxy klasse met de opgegeven URI, bypass-instelling en lijst met URI's die moeten worden omzeild.
public:
WebProxy(System::String ^ Address, bool BypassOnLocal, cli::array <System::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())
Parameters
- Address
- String
De URI van de proxyserver.
- BypassOnLocal
- Boolean
true om de proxy voor lokale adressen te omzeilen; anders, false.
- BypassList
- String[]
Een matrix van reguliere expressietekenreeksen die de URI's van de servers bevatten die moeten worden omzeild.
Uitzonderingen
Address is een ongeldige URI.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
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);
}
Opmerkingen
Het WebProxy exemplaar wordt geïnitialiseerd met de Address eigenschap ingesteld op een Uri exemplaar dat de BypassProxyOnLocal eigenschap bevat Addressdie is ingesteld op BypassOnLocal, en de BypassList eigenschap ingesteld op BypassList.
Zie ook
Van toepassing op
WebProxy(Uri, Boolean)
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)
Parameters
- BypassOnLocal
- Boolean
true om de proxy voor lokale adressen te omzeilen; anders, false.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
public static WebProxy CreateProxyWithExampleAddress(bool bypassLocal)
{
return new WebProxy(new Uri("http://contoso"), bypassLocal);
}
Opmerkingen
Het WebProxy exemplaar wordt geïnitialiseerd met de Address eigenschap ingesteld op Address en met de BypassProxyOnLocal eigenschap ingesteld op BypassOnLocal.
Van toepassing op
WebProxy(Uri, Boolean, String[], ICredentials)
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);
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)
Parameters
- BypassOnLocal
- Boolean
true om de proxy voor lokale adressen te omzeilen; anders, false.
- BypassList
- String[]
Een matrix met tekenreeksen voor reguliere expressies die de URI's van de servers bevatten die moeten worden omzeild.
- Credentials
- ICredentials
Een ICredentials exemplaar dat moet worden verzonden naar de proxyserver voor verificatie.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
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);
}
Opmerkingen
Het WebProxy exemplaar wordt geïnitialiseerd met de Address eigenschap ingesteld op Address, de BypassProxyOnLocal eigenschap ingesteld op BypassOnLocal, de BypassList eigenschap ingesteld op BypassListen de Credentials eigenschap ingesteld op Credentials.
Van toepassing op
WebProxy(String, Boolean)
Initialiseert een nieuw exemplaar van de WebProxy klasse met de opgegeven URI en bypass-instelling.
public:
WebProxy(System::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)
Parameters
- Address
- String
De URI van de proxyserver.
- BypassOnLocal
- Boolean
true om de proxy voor lokale adressen te omzeilen; anders, false.
Uitzonderingen
Address is een ongeldige URI.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
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;
}
Opmerkingen
Het WebProxy exemplaar wordt geïnitialiseerd met de Address eigenschap ingesteld op een Uri exemplaar dat de eigenschap bevat Address en waarop de BypassProxyOnLocal eigenschap is ingesteld BypassOnLocal.
Zie ook
Van toepassing op
WebProxy(SerializationInfo, StreamingContext)
Initialiseert een exemplaar van de WebProxy klasse met behulp van eerder geserialiseerde inhoud.
protected:
WebProxy(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
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
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)
Parameters
- serializationInfo
- SerializationInfo
De serialisatiegegevens.
- streamingContext
- StreamingContext
De context voor de geserialiseerde gegevens.
Opmerkingen
Deze methode wordt aangeroepen door het systeem om een WebProxy exemplaar te deserialiseren. Toepassingen noemen deze methode niet.
Van toepassing op
WebProxy(Uri)
public:
WebProxy(Uri ^ Address);
public WebProxy(Uri Address);
new System.Net.WebProxy : Uri -> System.Net.WebProxy
Public Sub New (Address As Uri)
Parameters
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
public static WebProxy CreateProxyWithExampleAddress()
{
return new WebProxy(new Uri("http://contoso"));
}
Opmerkingen
Het WebProxy exemplaar wordt geïnitialiseerd met de Address eigenschap ingesteld op de Address parameter.
Van toepassing op
WebProxy(String)
Initialiseert een nieuw exemplaar van de WebProxy klasse met de opgegeven URI.
public:
WebProxy(System::String ^ Address);
public WebProxy(string Address);
new System.Net.WebProxy : string -> System.Net.WebProxy
Public Sub New (Address As String)
Parameters
- Address
- String
De URI van de proxyserver.
Uitzonderingen
Address is een ongeldige URI.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
public static WebProxy CreateProxyWithHost()
{
return new WebProxy("http://contoso");
}
Opmerkingen
Het WebProxy exemplaar wordt geïnitialiseerd met de Address eigenschap ingesteld op een Uri exemplaar met Address.
Van toepassing op
WebProxy(String, Int32)
Initialiseert een nieuw exemplaar van de WebProxy klasse met het opgegeven host- en poortnummer.
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)
Parameters
- Host
- String
De naam van de proxyhost.
- Port
- Int32
Het poortnummer dat moet Host worden gebruikt.
Uitzonderingen
De URI gevormd door combinatie en HostPort is geen geldige URI.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u deze constructor aanroept.
public static WebProxy CreateProxyWithHostAndPort()
{
return new WebProxy("contoso", 80);
}
Opmerkingen
Het WebProxy exemplaar wordt geïnitialiseerd met de Address eigenschap ingesteld op een Uri exemplaar van het formulier http:// Host : Port.