Change User Agent on WPF/XAML Web Browser control?

风流意气都作罢 提交于 2019-12-02 18:24:43

问题


Is it possible to change the user agent on the XAML webbrowser control? The code as currently written looks like this:

<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="WpfApplication5.Window1"
x:Name="Window"
Title="Test01 - Browser"
Width="1024" Height="600">

<Grid x:Name="LayoutRoot">
    <WebBrowser x:Name="webBrowser" Source="http://gmail.com"/>
</Grid>
</Window>

Is it possible to change the user agent of this control? I am a complete newbie, as in, less than 4 hours of total coding, so please forgive me if this is obvious to anyone else. I have searched the MSDN page for the control (http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx) with no apparent solution given, so I'm asking in the hopes that it is easy.

I have absolutely zero C# or XAML experience outside of today. I'm a classic ASP (web) guy who needs to move into the modern world of desktop programming. This is merely a test application to see if things are possible. Since I'm a classic web guy, having a basic application that I can test with to verify user agents would be a handy tool to have.

Thanks, Beems


回答1:


UPDATE: There is no direct solution for this.



来源:https://stackoverflow.com/questions/4675078/change-user-agent-on-wpf-xaml-web-browser-control

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