Windows Phone 7的Web浏览器控件的用户代理

问题描述:

本用户代理浏览器控件,我在模拟器中看到的是的Mozilla / 5.0(兼容; MSIE 9.0; Windows手机OS 7.5;三叉戟/ 5.0; IEMobile / 9.0;微软; XDeviceEmulator) ,我想改变这种状况,以的Mozilla / 5.0的Windows NT 6.1为AppleWebKit / 535.1 KHTML,例如Gecko浏览器/ Safari浏览器14.0.835.187 / 535.1 什么相似。

The present user agent for the browser control that i see in the emulator is Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Microsoft; XDeviceEmulator) and i want to change that to Mozilla/5.0 Windows NT 6.1 AppleWebKit/535.1 KHTML, like Gecko Chrome/14.0.835.187 Safari/535.1 or something similar.

如何代码,在C#中更改Web浏览器控件的用户代理字符串。

How to code that in C# to change the user agent string for the web browser control.

找到了一种方法 webBrowser.Navigate(HTTP://localhost/run.php空的User-Agent:这里将用户代理);