问题
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