WebProxy.IsBypassed(Uri) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 호스트에 프록시 서버를 사용할지 여부를 나타냅니다.
public:
virtual bool IsBypassed(Uri ^ host);
public bool IsBypassed(Uri host);
abstract member IsBypassed : Uri -> bool
override this.IsBypassed : Uri -> bool
Public Function IsBypassed (host As Uri) As Boolean
매개 변수
반환
프록시 서버를 host로 사용하지 말아야 하면 true이고, 그렇지 않으면 false입니다.
구현
예외
host 매개 변수가 null인 경우
예제
다음 코드 예제에서는 개체를 WebProxy 만들고 이 메서드를 호출하여 바이패스 목록이 제대로 설정되었는지 확인합니다.
public static WebProxy CreateProxyAndCheckBypass(bool bypassLocal)
{
// Do not use the proxy server for Contoso.com URIs.
string[] bypassList = new string[]{";*.Contoso.com"};
WebProxy proxy = new WebProxy("http://contoso",
bypassLocal,
bypassList);
// Test the bypass list.
if (!proxy.IsBypassed(new Uri("http://www.Contoso.com")))
{
Console.WriteLine("Bypass not working!");
return null;
}
else
{
Console.WriteLine("Bypass is working.");
return proxy;
}
}
설명
메서드는 IsBypassed 인터넷 리소스에 액세스할 때 프록시 서버를 바이패스할지 여부를 결정하는 데 사용됩니다.
및 속성은 BypassProxyOnLocal 메서드의 반환 값을 제어합니다IsBypassed.BypassList
IsBypassed 는 다음 조건 중에서 를 반환 true 합니다.
가 이
true고host가 로컬 URI인 경우 BypassProxyOnLocal 로컬 요청은 와 같이 URI에 마침표(.)가 없으므로 식별됩니다http://webserver/.의 정규식BypassList과 일치하는 경우
hostAddress이
null인 경우입니다.
다른 모든 조건은 를 반환합니다 false.