IWebProxy.IsBypassed(Uri) Método
Definição
Indica que o proxy não deve ser usado para o host especificado.Indicates that the proxy should not be used for the specified host.
public:
bool IsBypassed(Uri ^ host);
public bool IsBypassed (Uri host);
abstract member IsBypassed : Uri -> bool
Public Function IsBypassed (host As Uri) As Boolean
Parâmetros
- host
- Uri
O Uri do host a ser verificado quanto ao uso do proxy.The Uri of the host to check for proxy use.
Retornos
true caso o servidor proxy não deva ser usado para host; caso contrário, false.true if the proxy server should not be used for host; otherwise, false.
Exemplos
O exemplo a seguir usa a IsBypassed propriedade para determinar se o servidor proxy deve ser usado para o host especificado.The following example uses the IsBypassed property to determine whether the proxy server should be used for the specified host.
WebProxy_Interface^ webProxy_Interface = gcnew WebProxy_Interface( gcnew Uri( "http://proxy.example.com" ) );
webProxy_Interface->Credentials = gcnew NetworkCredential( "myusername", "mypassword" );
Console::WriteLine( "The web proxy is : {0}", webProxy_Interface->GetProxy( gcnew Uri( "http://www.contoso.com" ) ) );
// Check if the webproxy can ne bypassed for the site "http://www.contoso.com".
if ( webProxy_Interface->IsBypassed( gcnew Uri( "http://www.contoso.com" ) ) )
{
Console::WriteLine( "Web Proxy is by passed" );
}
else
{
Console::WriteLine( "Web Proxy is not by passed" );
}
WebProxy_Interface webProxy_Interface = new WebProxy_Interface(new Uri("http://proxy.example.com"));
webProxy_Interface.Credentials = new NetworkCredential("myusername", "mypassword");
Console.WriteLine("The web proxy is : {0}", webProxy_Interface.GetProxy(new Uri("http://www.contoso.com")));
// Determine whether the Web proxy can be bypassed for the site "http://www.contoso.com".
if(webProxy_Interface.IsBypassed(new Uri("http://www.contoso.com")))
Console.WriteLine("Web Proxy is by passed");
else
Console.WriteLine("Web Proxy is not by passed");
Public Shared Sub Main()
Dim webProxy_Interface As New WebProxy_Interface(New Uri("http://proxy.example.com"))
webProxy_Interface.Credentials = New NetworkCredential("myusername", "mypassword")
Console.WriteLine("The web proxy is : {0}", webProxy_Interface.GetProxy(New Uri("http://www.contoso.com")))
'Determine whether the Web proxy can be bypassed for the site "http://www.contoso.com".
console.writeline("For the Uri http://www.contoso.com , the ")
If webProxy_Interface.IsBypassed(New Uri("http://www.contoso.com")) Then
Console.WriteLine("webproxy is by passed")
Else
Console.WriteLine("webproxy is not bypassed")
End If
End Sub
Comentários
O IsBypassed método indica se o servidor proxy deve ser usado para acessar o host especificado no host parâmetro.The IsBypassed method indicates whether to use the proxy server to access the host that is specified in the host parameter. Se IsBypassed for true , o proxy não será usado para contatar o host e a solicitação será passada diretamente para o servidor.If IsBypassed is true, the proxy is not used to contact the host and the request is passed directly to the server.