Windows Phone 7 中的 HttpWebRequest.Proxy? [英] HttpWebRequest.Proxy in Windows Phone 7?

查看:13
本文介绍了Windows Phone 7 中的 HttpWebRequest.Proxy?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET Compact Framework 似乎不包含 HttpWebRequest 的 Proxy 属性.

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

无论如何,我可以在从 HttpWebRequest 读取时使用代理吗?

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

推荐答案

不,目前无法在您的应用程序中以编程方式执行此操作.在 Windows 代理设置是在 Internet Explorer 中配置的.在手机上,您可以从设置"中的编辑网络"中配置代理设置,如果您这样做并且您已连接到 WiFi 网络,它将通过代理进行连接.

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.

但是,如果您真的想有问题地选择从您的应用程序通过代理进行连接,您可以使用 Mango 版本来做到这一点.在 mango 中,您将可以更好地访问网络堆栈,您将能够使用原始的 System.Net.Socket 使用 TCP/IP 连接到代理.您将连接到代理,然后手动构建 Http Header,响应将包含通过代理服务器的 Http 响应.

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.

这篇关于Windows Phone 7 中的 HttpWebRequest.Proxy?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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