简体   繁体   English

C#WinForm Web浏览器不支持的浏览器

[英]C# WinForm Web Browser Unsupported Browser

This is my last resort as I've looked all over this site for a fix, but everything I've tried doesn't work. 这是我的最后一招,因为我在整个网站上都找了个解决方法,但我尝试过的所有方法均无效。

Issue: I want to navigate to www.espn.com via a webbrowser tool in my winform app, but I am only able to get a degraded version of espn since it tells me I'm using an unsupported browser. 问题:我想通过Winform应用程序中的Webbrowser工具浏览到www.espn.com,但是我只能获得espn的降级版本,因为它告诉我我使用的是不受支持的浏览器。

What I've tried: I've tried multiple solutions where you change/add a registry key to the FEATURE_BROWSER_EMULATION but it doesn't seem to change anything. 我尝试过的事情:我尝试了多种解决方案,在这些解决方案中,您将注册表项更改/添加到了FEATURE_BROWSER_EMULATION,但似乎没有任何改变。

This link is the code I've tried to fix this issue but no such luck. 此链接是我尝试解决此问题的代码,但没有运气。

Use latest version of Internet Explorer in the webbrowser control 在Webbrowser控件中使用Internet Explorer的最新版本

Anyone have any ideas??? 有人有想法么???

This is my current result: 这是我目前的结果: 在此处输入图片说明

it looks like you are running your windows forms project in debug mode from visual studio? 看起来您是从Visual Studio以调试模式运行Windows窗体项目的? Fist your need to add the BROWSER_EMULATION keys to your registry...a name value pair, where the name is the name of the exe that your project compiles to, and a value (as described here - Use latest version of Internet Explorer in the webbrowser control ) for the version of IE you wish to use (use 11). 首先需要将BROWSER_EMULATION项添加到注册表中...一个名称值对,其中名称是项目编译到的exe的名称,以及一个值(如此处所述- 使用最新版本的Internet Explorer) webbrowser控件 ),用于您要使用的IE版本(使用11)。 here is a snippet from my registry 这是我注册表中的片段

[Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"HelpPane.exe"=dword:00002710
"prevhost.exe"=dword:00001f40
"Fiddler.exe"=dword:0000270f
"XMLViewerHPSF.exe"=dword:00002af8
"sllauncher.exe"=dword:00001f40

showing the name value pairs in the registry... 在注册表中显示名称值对...

Second , you then compile your webforms project to an exe with the name you used in the registry. 其次 ,然后使用您在注册表中使用的名称将Webforms项目编译为一个exe。 eg myWBC.exe 例如myWBC.exe

Unfortunately, you cannot use the BROWSER_EMULATION key(s) when debugging from VS. 不幸的是,从VS调试时不能使用BROWSER_EMULATION键。 You can only test your compiled project. 您只能测试编译的项目。

Regards. 问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM