本文整理匯總了C#中System.Net.WebProxy.WebProxy構造函數的典型用法代碼示例。如果您正苦於以下問題:C# WebProxy構造函數的具體用法?C# WebProxy怎麽用?C# WebProxy使用的例子?那麽, 這裏精選的構造函數代碼示例或許可以為您提供幫助。您也可以進一步了解該構造函數所在類System.Net.WebProxy
的用法示例。
在下文中一共展示了WebProxy構造函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateProxy
public static WebProxy CreateProxy()
{
return new WebProxy();
}
示例2: CreateProxyWithHost
public static WebProxy CreateProxyWithHost()
{
return new WebProxy("http://contoso");
}
示例3: CreateProxyWithExampleAddress
public static WebProxy CreateProxyWithExampleAddress()
{
return new WebProxy(new Uri("http://contoso"));
}
示例4: CreateProxyWithHostAddress
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;
}
示例5: CreateProxyWithHostAndPort
public static WebProxy CreateProxyWithHostAndPort()
{
return new WebProxy("contoso", 80);
}
示例6: CreateProxyWithExampleAddress
public static WebProxy CreateProxyWithExampleAddress(bool bypassLocal)
{
return new WebProxy(new Uri("http://contoso"), bypassLocal);
}
示例7: CreateProxyWithHostAndBypassList
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);
}
示例8: CreateProxyWithBypassList
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);
}
示例9: CreateProxyWithCredentials
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);
}
示例10: CreateProxyWithCredentials2
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);
}