Share via


WebProxy Oluşturucular

Tanım

WebProxy sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

WebProxy()

sınıfının boş bir örneğini WebProxy başlatır.

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

Belirtilen URI, atlama ayarı, atlanan URI'lerin listesi ve kimlik bilgileri ile sınıfın yeni bir örneğini WebProxy başlatır.

WebProxy(Uri, Boolean, String[])

Belirtilen Uri örnek, atlama ayarı ve atlanan URI'lerin listesiyle sınıfının yeni bir örneğini WebProxy başlatır.

WebProxy(String, Boolean, String[])

Sınıfın WebProxy yeni bir örneğini belirtilen URI, atlama ayarı ve atlayacak URI'lerin listesiyle başlatır.

WebProxy(Uri, Boolean)

örneği ve atlama ayarıyla sınıfının yeni bir örneğini WebProxyUri başlatır.

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

Belirtilen Uri örnek, atlama ayarı, atlanan URI'lerin listesi ve kimlik bilgileriyle sınıfın yeni bir örneğini WebProxy başlatır.

WebProxy(String, Boolean)

Belirtilen URI ve atlama ayarıyla sınıfın WebProxy yeni bir örneğini başlatır.

WebProxy(SerializationInfo, StreamingContext)
Geçersiz.

Daha önce seri hale getirilmiş içeriği kullanarak sınıfın WebProxy bir örneğini başlatır.

WebProxy(Uri)

Belirtilen Uri örnekten WebProxy sınıfının yeni bir örneğini başlatır.

WebProxy(String)

Belirtilen URI ile sınıfının yeni bir örneğini WebProxy başlatır.

WebProxy(String, Int32)

Belirtilen konak ve bağlantı noktası numarasıyla sınıfının yeni bir örneğini WebProxy başlatır.

WebProxy()

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

sınıfının boş bir örneğini WebProxy başlatır.

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

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

Parametresiz oluşturucu, özelliğinin olarak ayarlandığı nullsınıfın WebProxyAddress boş bir örneğini başlatır.

Address özelliği olduğunda nullIsBypassed yöntemi, true yöntemi ise GetProxy hedef adresi döndürür.

Şunlara uygulanır

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

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

Belirtilen URI, atlama ayarı, atlanan URI'lerin listesi ve kimlik bilgileri ile sınıfın yeni bir örneğini WebProxy başlatır.

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)

Parametreler

Address
String

Proxy sunucusunun URI'si.

BypassOnLocal
Boolean

true yerel adreslerin ara sunucusunu atlamak için; aksi takdirde , false.

BypassList
String[]

Atlayacak sunucuların URI'lerini içeren normal ifade dizeleri dizisi.

Credentials
ICredentials

ICredentials Kimlik doğrulaması için ara sunucuya göndermek için bir örnek.

Özel durumlar

Address geçersiz bir URI'dir.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

ÖrnekWebProxy, özelliğini içeren AddressBypassProxyOnLocal bir Uri örneğe ayarlanmış, özelliği olarak ayarlanmışBypassOnLocalBypassList, özelliği olarak ayarlanmış BypassListve Credentials özelliği olarak ayarlanmış Credentialsşekilde başlatılırAddress.

Ayrıca bkz.

Şunlara uygulanır

WebProxy(Uri, Boolean, String[])

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

Belirtilen Uri örnek, atlama ayarı ve atlanan URI'lerin listesiyle sınıfının yeni bir örneğini WebProxy başlatır.

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

Parametreler

Address
Uri

Uri Ara sunucunun adresini içeren bir örnek.

BypassOnLocal
Boolean

true yerel adreslerin ara sunucusunu atlamak için; aksi takdirde , false.

BypassList
String[]

Atlayacak sunucuların URI'lerini içeren normal ifade dizeleri dizisi.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

ÖrnekWebProxy, özelliği olarak, AddressBypassProxyOnLocal özelliği olarak, BypassOnLocalözelliği ise BypassList olarak ayarlanmış BypassListşekilde başlatılırAddress.

Şunlara uygulanır

WebProxy(String, Boolean, String[])

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

Sınıfın WebProxy yeni bir örneğini belirtilen URI, atlama ayarı ve atlayacak URI'lerin listesiyle başlatır.

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

Parametreler

Address
String

Proxy sunucusunun URI'si.

BypassOnLocal
Boolean

true yerel adreslerin ara sunucusunu atlamak için; aksi takdirde , false.

BypassList
String[]

Atlayacak sunucuların URI'lerini içeren normal ifade dizeleri dizisi.

Özel durumlar

Address geçersiz bir URI'dir.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

ÖrnekWebProxy, özelliği içeren AddressBypassProxyOnLocal bir Uri örneğe ayarlanmış, özelliği olarak ve BypassListBypassOnLocalözelliği olarak ayarlanmış BypassListşekilde başlatılırAddress.

Ayrıca bkz.

Şunlara uygulanır

WebProxy(Uri, Boolean)

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

örneği ve atlama ayarıyla sınıfının yeni bir örneğini WebProxyUri başlatır.

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)

Parametreler

Address
Uri

Uri Ara sunucunun adresini içeren bir örnek.

BypassOnLocal
Boolean

true yerel adreslerin ara sunucusunu atlamak için; aksi takdirde , false.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

ÖrnekWebProxy, ve özelliği olarak ayarlanmış Address ve özelliği olarak BypassOnLocalayarlanmış şekilde BypassProxyOnLocal başlatılırAddress.

Şunlara uygulanır

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

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

Belirtilen Uri örnek, atlama ayarı, atlanan URI'lerin listesi ve kimlik bilgileriyle sınıfın yeni bir örneğini WebProxy başlatır.

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)

Parametreler

Address
Uri

Uri Ara sunucunun adresini içeren bir örnek.

BypassOnLocal
Boolean

true yerel adreslerin ara sunucusunu atlamak için; aksi takdirde , false.

BypassList
String[]

Atlayacak sunucuların URI'lerini içeren normal ifade dizeleri dizisi.

Credentials
ICredentials

ICredentials Kimlik doğrulaması için ara sunucuya göndermek için bir örnek.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

ÖrnekWebProxy, özelliği olarak ayarlanmış BypassProxyOnLocalAddress, özelliği olarak ayarlanmışBypassOnLocalBypassList, özelliği olarak Credentials ve BypassListözelliği olarak ayarlanmış Credentialsşekilde Address başlatılır.

Şunlara uygulanır

WebProxy(String, Boolean)

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

Belirtilen URI ve atlama ayarıyla sınıfın WebProxy yeni bir örneğini başlatır.

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)

Parametreler

Address
String

Proxy sunucusunun URI'si.

BypassOnLocal
Boolean

true yerel adreslerin ara sunucusunu atlamak için; aksi takdirde , false.

Özel durumlar

Address geçersiz bir URI'dir.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

ÖrnekWebProxy, özelliği içeren Address bir Uri örneğe ayarlanmış ve BypassProxyOnLocal özelliği olarak ayarlanmış şekilde BypassOnLocalbaşlatılırAddress.

Ayrıca bkz.

Şunlara uygulanır

WebProxy(SerializationInfo, StreamingContext)

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

Dikkat

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

Daha önce seri hale getirilmiş içeriği kullanarak sınıfın WebProxy bir örneğini başlatır.

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)

Parametreler

serializationInfo
SerializationInfo

Serileştirme verileri.

streamingContext
StreamingContext

Seri hale getirilmiş verilerin bağlamı.

Öznitelikler

Açıklamalar

Bu yöntem sistem tarafından bir WebProxy örneğin seri durumdan çıkarılması için çağrılır; uygulamalar bunu çağırmaz.

Şunlara uygulanır

WebProxy(Uri)

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

Belirtilen Uri örnekten WebProxy sınıfının yeni bir örneğini başlatır.

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)

Parametreler

Address
Uri

Uri Ara sunucunun adresini içeren bir örnek.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

Örnek WebProxy , parametresine Address ayarlanmış Address özelliğiyle başlatılır.

Şunlara uygulanır

WebProxy(String)

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

Belirtilen URI ile sınıfının yeni bir örneğini WebProxy başlatır.

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)

Parametreler

Address
String

Proxy sunucusunun URI'si.

Özel durumlar

Address geçersiz bir URI'dir.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

ÖrnekWebProxy, özelliğini içeren Addressbir örneğe ayarlanmış şekilde Uri başlatılırAddress.

Şunlara uygulanır

WebProxy(String, Int32)

Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs
Kaynak:
WebProxy.cs

Belirtilen konak ve bağlantı noktası numarasıyla sınıfının yeni bir örneğini WebProxy başlatır.

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)

Parametreler

Host
String

Ara sunucu konağı adı.

Port
Int32

Kullanılacak bağlantı noktası numarası Host .

Özel durumlar

Birleştirilerek HostPort oluşturulan URI geçerli bir URI değil.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun çağrılması gösterilmektedir.

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

Açıklamalar

ÖrnekWebProxy, http:// formun Host bir Uri örneğine ayarlanmış özelliğiyle Address başlatılır: Port.

Şunlara uygulanır