将webbrower控件中的网站首选项设置为移动版本 [英] Setting website preference in webbrower control to mobile version

查看:86
本文介绍了将webbrower控件中的网站首选项设置为移动版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的团队,



我们在其中一个应用程序中使用Web浏览器控件。目前,Web浏览器控件打开了网站的桌面版本。我们找不到能够在桌面或移动版网页之间进行选择的API。



我们如何在网络中将网站偏好设置为移动版本浏览器控制?
$


问候,



Mango Techno

Dear Team,

We are using web browser control in one of our application. Currently the web browser control opens the desktop version of the website. We could not find an API that enables to choose between the Desktop or the Mobile version of a web page.

How can we set the website preference to mobile version in web browser control?

Regards,


Mango Techno

推荐答案

您好,

您可以将用户代理更改为桌面或移动 并发送。这可能会给你预期的结果。

You can change the user agent to desktop or Mobile and send. This may give you the expected result.

webBrowser1.Navigate(    new Uri(        textBox1.Text    ),    null,    "User-Agent: Mozilla 5.0 (Linux; U; Android 2.3.7; zh-cn; MB525 Build MIUI) UC AppleWebKit 534.31 (KHTML, like Gecko) Mobile Safari 534.31");





这篇关于将webbrower控件中的网站首选项设置为移动版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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