HttpWebRequest.Proxy in Windows Phone 7?

ぐ巨炮叔叔 提交于 2020-01-10 04:27:04

问题


It seems that .NET Compact Framework does not include a Proxy property for HttpWebRequest.

Is there anyway, I can use proxy when reading from a HttpWebRequest?


回答1:


No this is not currently possible to do it programatically from within your application. In windows proxy settings are configured in internet explorer. On the phone you can configure proxy settings from Edit Network inside Settings, if you do this and you are connected to a WiFi network it will make the connection go via the proxy.

However if you really want to problematically opt to connect via a proxy from your application you could do this With Mango release. In mango you will have greater access to the networking stack, you would be able to connect to a proxy using TCP/IP using System.Net.Socket in the raw. You would connect to the Proxy and then construct the Http Header Manually, the response would contain the Http response via the proxy server.




回答2:


No currently you cant use a Proxy with WebClient or HttpWebRequest. With Mango you can use Sockets.



来源:https://stackoverflow.com/questions/6976087/httpwebrequest-proxy-in-windows-phone-7

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