如何有C#的WPF的网站WebBrowser控件加载手机版 [英] how to have the c# wpf webbrowser control load mobile version of websites

查看:346
本文介绍了如何有C#的WPF的网站WebBrowser控件加载手机版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WebBrowser控件一个简单的WPF应用程序。当我直接控制加载页面我想有控制告诉服务器它试图从它的移动设备加载页面,因此加载页面的缩小版。我知道很多网站的地址之前只加移动,所以google.com的移动网页是mobile.google.com,但我不知道是否有装载在Web服务器自动将我的WebBrowser控件的方法该网站的移动版本?我觉得应该有一个非常简单的方式做到这一点,但我不能看着办吧。)

I have a simple WPF application with a webbrowser control. When I direct the control to load a page I'd like to have the control tell the server it's trying to load the page from that it's a mobile device and therefore load the smaller version of the page. I know a lot of sites just add mobile before the address, so google.com's mobile page is just mobile.google.com, but I'm wondering if there is a way to load the have the web server automatically direct my webbrowser control to the mobile version of the site? I feel like there should be a very simple way to do this, but I just can't figure it out :).

在此先感谢!

推荐答案

这一般由网站使用的用户代理,这是不是你可以用标准的WebBrowser控件改变。还有一个另外的WPF WebBrowser控件的基础上,,你可以从<下载HREF =HTTP://wpfchromium.$c$cplex.com/相对=nofollow> codePLEX 。它可能不支持用户代理欺骗开箱即用,但它是开源的,所以你可以手动更改在code到iPhone,Windows Mobile的等。

This will generally be controlled by the site using the User Agent, which is not something you can change with the standard WebBrowser control. There is an alternative WPF webbrowser control, based on Chromium, which you can download from CodePlex. It might not support User Agent spoofing out of the box, but it's open source so you can manually change it in the code to an iPhone, Windows Mobile etc.

这篇关于如何有C#的WPF的网站WebBrowser控件加载手机版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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