本文介绍了在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 proxy = (WebProxy) WebRequest.DefaultWebProxy;
if (proxy.Address.AbsoluteUri != string.Empty)
{
Console.WriteLine("Proxy URL: " + proxy.Address.AbsoluteUri);
wc.Proxy = proxy;
}

参考:

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

10-26 18:40