如何让我的c#web浏览器支持html5 [英] how make my c# web browser to support html5
本文介绍了如何让我的c#web浏览器支持html5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何让我的c#web浏览器支持html5
解决方案
好的,找到答案(至少在C ++中托管Webbrowser控件的情况下)
您必须添加一个注册表条目:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer \\ \\ MAIN \FeatureControl \ FEATURE_BROWSER_EMULATION
适用于32位操作系统
*******或***** *****
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer \ MAIN \\ \\ FeatureControl\FEATURE_BROWSER_EMULATION
64位操作系统
此条目必须是DWORD, name是承载Webbrowser控件的可执行文件的名称;即:
myappname.exe(请勿在MSDN网页中使用Contoso.exe...它只是一个占位符名称)
然后根据表格给它一个DWORD值:
http://msdn.microsoft.com/en-us/library/ee330730(v=vs.85) .aspx#browser_emulation
我改为11001十进制或0x2AF9十六进制---(IE 11仿真)
为什么这不是DEFAULT值(当你安装IE 11时 - 或者任何版本),而不是IE 7或8,我永远不会知道...
问题解决了(至少在这种情况下!)
GWK
WebBrowser控件只是系统上安装的IE浏览器的.NET包装器。因此,如果您运行应用程序的PC具有支持HTML5的IE版本,那么WebBrowser控件也应该如此。如果没有,那么你的应用也不会。
这个解决方案像魅力一样工作
http:/ /stackoverflow.com/questions/18333459/c-sharp-webbrowser-ajax-call
how make my c# web browser to support html5
解决方案
OK, found the answer (at least for the case of hosting the Webbrowser control in C++)
You must add a registry entry to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
For 32bit OS
*******OR*******
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
For 64bit OS
and this entry must be a DWORD, with the name being the name of your executable, that hosts the Webbrowser control; i.e.:
myappname.exe (DON'T USE "Contoso.exe" as in the MSDN web page...it's just a placeholder name)
Then give it a DWORD value, according to the table on:
http://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx#browser_emulation
I changed to 11001 decimal or 0x2AF9 hex --- (IE 11 EMULATION)
WHY that isn't the DEFAULT value (When you have IE 11 installed -- or whatever version), instead of IE 7 or 8, I'll never know...
PROBLEM SOLVED (at least in this case!)
GWK
The WebBrowser control is just a .NET wrapper for the IE browser installed on your system. So if the PC you run your application on has a version of IE that supports HTML5, then the WebBrowser control should as well. If it doesn't, then your app won't either.
This solution work like a charm
http://stackoverflow.com/questions/18333459/c-sharp-webbrowser-ajax-call
这篇关于如何让我的c#web浏览器支持html5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文