在WP8上读取代理设置 [英] Read proxy settings on WP8

查看:139
本文介绍了在WP8上读取代理设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在WP8上读取当前连接的代理设置?
问题是我正在尝试使用来自Eldos Secure BlackBox的https客户端,但它似乎没有使用系统中定义的代理设置,因此在代理后面我无法访问任何服务器。
或者可能还有其他方法吗?

Is there any way to read proxy settings for current connections on WP8? The problem is that I'm trying to use https client from Eldos Secure BlackBox but it doesn't seem to use proxy settings defined in system so beeing behind the proxy I can't access any server. Or maybe there is any other approaches?

推荐答案

您是否尝试使用 WebProxy 类?

示例代码:

WebProxy proxy = (WebProxy) WebRequest.DefaultWebProxy;
if (proxy.Address.AbsoluteUri != string.Empty)
{
Console.WriteLine("Proxy URL: " + proxy.Address.AbsoluteUri);
wc.Proxy = proxy;
}

参考: C#自动检测代理设置

HttpWebRequest。 Windows Phone 7中的代理?

这篇关于在WP8上读取代理设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆