本文整理汇总了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);
}