WebProxy 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
WebProxy 클래스의 새 인스턴스를 초기화합니다.
오버로드
| Name | Description |
|---|---|
| WebProxy() |
클래스의 빈 인스턴스를 초기화합니다 WebProxy . |
| WebProxy(String, Boolean, String[], ICredentials) |
지정된 URI, 바이패스 설정, 바이패스할 URI 목록 및 자격 증명을 사용하여 클래스의 새 인스턴스 WebProxy 를 초기화합니다. |
| WebProxy(Uri, Boolean, String[]) |
지정된 Uri 인스턴스WebProxy, 바이패스 설정 및 바이패스할 URI 목록을 사용하여 클래스의 새 인스턴스를 초기화합니다. |
| WebProxy(String, Boolean, String[]) |
지정된 URI, 바이패스 설정 및 바이패스할 URI 목록을 사용하여 클래스의 새 인스턴스 WebProxy 를 초기화합니다. |
| WebProxy(Uri, Boolean) | |
| WebProxy(Uri, Boolean, String[], ICredentials) |
지정된 Uri 인스턴스, 바이패스 설정, 바이패스할 URI 목록 및 자격 증명을 사용하여 클래스의 새 인스턴스 WebProxy 를 초기화합니다. |
| WebProxy(String, Boolean) |
지정된 URI 및 바이패스 설정을 사용하여 클래스의 WebProxy 새 인스턴스를 초기화합니다. |
| WebProxy(SerializationInfo, StreamingContext) |
사용되지 않음.
이전에 직렬화된 콘텐츠를 사용하여 클래스의 WebProxy 인스턴스를 초기화합니다. |
| WebProxy(Uri) | |
| WebProxy(String) |
지정된 URI를 사용하여 클래스의 WebProxy 새 인스턴스를 초기화합니다. |
| WebProxy(String, Int32) |
지정된 호스트 및 포트 번호를 사용하여 클래스의 WebProxy 새 인스턴스를 초기화합니다. |
WebProxy()
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
클래스의 빈 인스턴스를 초기화합니다 WebProxy .
public:
WebProxy();
public WebProxy();
Public Sub New ()
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
public static WebProxy CreateProxy()
{
return new WebProxy();
}
설명
매개 변수가 없는 생성자는 속성이 설정된 클래스의 WebProxy 빈 인스턴스를 Address 초기화합니다 null.
속성이 Address 있으면 null메서드가 IsBypassed 반환 true 되고 메서드가 GetProxy 대상 주소를 반환합니다.
적용 대상
WebProxy(String, Boolean, String[], ICredentials)
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
지정된 URI, 바이패스 설정, 바이패스할 URI 목록 및 자격 증명을 사용하여 클래스의 새 인스턴스 WebProxy 를 초기화합니다.
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)
매개 변수
- Address
- String
프록시 서버의 URI입니다.
- BypassOnLocal
- Boolean
true로컬 주소에 대한 프록시를 바이패스하려면 그렇지 않으면 . false
- BypassList
- String[]
바이패스할 서버의 URI를 포함하는 정규식 문자열의 배열입니다.
- Credentials
- ICredentials
ICredentials 인증을 위해 프록시 서버에 제출할 인스턴스입니다.
예외
Address 가 잘못된 URI입니다.
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
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);
}
설명
인스턴스가 WebProxy 포함된 인스턴스로 Address 설정된 Uri 속성, 속성 집합BypassOnLocal, BypassProxyOnLocalBypassList 속성 집합 및 Credentials 속성을 포함하는 Address인스턴스로 BypassList초기화됩니다Credentials.
추가 정보
적용 대상
WebProxy(Uri, Boolean, String[])
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
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())
매개 변수
- BypassOnLocal
- Boolean
true로컬 주소에 대한 프록시를 바이패스하려면 그렇지 않으면 . false
- BypassList
- String[]
바이패스할 서버의 URI를 포함하는 정규식 문자열의 배열입니다.
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
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 속성이 설정Address되고, 속성이 BypassProxyOnLocal 로 설정BypassOnLocal되고, 속성이 로 설정된 상태에서 BypassList 초기화 Address 됩니다BypassList.
적용 대상
WebProxy(String, Boolean, String[])
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
지정된 URI, 바이패스 설정 및 바이패스할 URI 목록을 사용하여 클래스의 새 인스턴스 WebProxy 를 초기화합니다.
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())
매개 변수
- Address
- String
프록시 서버의 URI입니다.
- BypassOnLocal
- Boolean
true로컬 주소에 대한 프록시를 바이패스하려면 그렇지 않으면 . false
- BypassList
- String[]
바이패스할 서버의 URI를 포함하는 정규식 문자열의 배열입니다.
예외
Address 가 잘못된 URI입니다.
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
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);
}
설명
인스턴스는
추가 정보
적용 대상
WebProxy(Uri, Boolean)
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
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)
매개 변수
- BypassOnLocal
- Boolean
true로컬 주소에 대한 프록시를 바이패스하려면 그렇지 않으면 . false
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
public static WebProxy CreateProxyWithExampleAddress(bool bypassLocal)
{
return new WebProxy(new Uri("http://contoso"), bypassLocal);
}
설명
인스턴스는 WebProxy 속성이 설정되고 속성이 Address .로 설정된 Address 상태에서 BypassProxyOnLocal 초기화됩니다 BypassOnLocal.
적용 대상
WebProxy(Uri, Boolean, String[], ICredentials)
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
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)
매개 변수
- BypassOnLocal
- Boolean
true로컬 주소에 대한 프록시를 바이패스하려면 그렇지 않으면 . false
- BypassList
- String[]
바이패스할 서버의 URI를 포함하는 정규식 문자열의 배열입니다.
- Credentials
- ICredentials
ICredentials 인증을 위해 프록시 서버에 제출할 인스턴스입니다.
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
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);
}
설명
인스턴스는 WebProxy 속성 집합, 속성 집합Address, BypassProxyOnLocal 속성 BypassOnLocalBypassList 집합 BypassList및 Credentials 속성을 사용하여 초기화 Address 됩니다Credentials.
적용 대상
WebProxy(String, Boolean)
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
지정된 URI 및 바이패스 설정을 사용하여 클래스의 WebProxy 새 인스턴스를 초기화합니다.
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)
매개 변수
- Address
- String
프록시 서버의 URI입니다.
- BypassOnLocal
- Boolean
true로컬 주소에 대한 프록시를 바이패스하려면 그렇지 않으면 . false
예외
Address 가 잘못된 URI입니다.
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
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;
}
설명
이 인스턴스는
추가 정보
적용 대상
WebProxy(SerializationInfo, StreamingContext)
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
주의
This API supports obsolete formatter-based serialization. It should not be called or extended by application code.
이전에 직렬화된 콘텐츠를 사용하여 클래스의 WebProxy 인스턴스를 초기화합니다.
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);
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}")>]
new System.Net.WebProxy : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.WebProxy
new System.Net.WebProxy : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.WebProxy
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)
매개 변수
- serializationInfo
- SerializationInfo
serialization 데이터입니다.
- streamingContext
- StreamingContext
직렬화된 데이터의 컨텍스트입니다.
- 특성
설명
이 메서드는 인스턴스를 역직렬화 WebProxy 하기 위해 시스템에서 호출됩니다. 애플리케이션은 인스턴스를 호출하지 않습니다.
적용 대상
WebProxy(Uri)
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
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)
매개 변수
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
public static WebProxy CreateProxyWithExampleAddress()
{
return new WebProxy(new Uri("http://contoso"));
}
설명
인스턴스는 WebProxy 매개 변수로 Address 설정된 속성으로 Address 초기화됩니다.
적용 대상
WebProxy(String)
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
지정된 URI를 사용하여 클래스의 WebProxy 새 인스턴스를 초기화합니다.
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)
매개 변수
- Address
- String
프록시 서버의 URI입니다.
예외
Address 가 잘못된 URI입니다.
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
public static WebProxy CreateProxyWithHost()
{
return new WebProxy("http://contoso");
}
설명
이 인스턴스는 WebProxy 속성이 Address 포함된 인스턴스로 설정된 상태에서 Uri 초기화됩니다 Address.
적용 대상
WebProxy(String, Int32)
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
- Source:
- WebProxy.cs
지정된 호스트 및 포트 번호를 사용하여 클래스의 WebProxy 새 인스턴스를 초기화합니다.
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)
매개 변수
- Host
- String
프록시 호스트의 이름입니다.
- Port
- Int32
사용할 포트 번호 Host 입니다.
예외
결합 Host 하여 형성된 URI이며 Port 유효한 URI가 아닙니다.
예제
다음 코드 예제에서는이 생성자를 호출 하는 방법을 보여 줍니다.
public static WebProxy CreateProxyWithHostAndPort()
{
return new WebProxy("contoso", 80);
}
설명
인스턴스는 WebProxy 다음과 같이 Address http:// HostPort형식의 인스턴스로 Uri 설정된 속성을 사용하여 초기화됩니다.