Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
301 views
in Technique[技术] by (71.8m points)

c# - Cannot force WebBrowser Control to render using current version of IE

I need the WebBrowser Control in my Windows Forms application to render pages using the latest version of Internet Explorer, or atleast the latest version that is installed on my machine - which is IE 11.

A few weeks ago, before I began working on this project I came across a website called DevDocs.io, and in IE 11 it works. However, even after applying the registry hack I cannot view DevDocs.io in the WebBrowser control because apparently I am using an "Unsupported" browser. It then goes on to say that I need to use either Firefox, Chrome or IE 10+. I thought I was using IE 10+ since I had added the DWORD to the registry.

I've come across many websites that just don't display or behave normally due to the fact that the WebBrowser control still isn't rendering in IE11, or 10, or 9...

There are two things I would like to know:

  • Is there a method or class that exposes the rendering engine being used by the WebBrowser Control?
  • Why isn't the DWORD Registry hack working, and how do I get it to work?

To be clear, I have gone to the Registry, and looked up: HKEY LOCAL MACHINE > SOFTWARE > MICROSOFT > INTERNET EXPLORER > MAIN > FEATURE CONTROL > FEATURE_BROWSER_EMULATION and added a DWORD with values myApp.exe and 11000.

The 11000 is to get it to render using IE11, as per http://msdn.microsoft.com/en-us/library/ee330730%28VS.85%29.aspx#browser_emulation.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to add your registry key under both the main (64bit) node and the 32bit node, HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControl

You should then visit http://webdbg.com/ua.aspx to verify the document mode and UA string.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...