Read proxy settings on WP8

若如初见. 提交于 2019-12-13 05:26:34

问题


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?


回答1:


Did you try using the WebProxy class?

Sample code:

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

Reference: C# auto detect proxy settings

HttpWebRequest.Proxy in Windows Phone 7?



来源:https://stackoverflow.com/questions/28057065/read-proxy-settings-on-wp8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!