Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

c# - Web Browser component is IE7 not IE8? How to change this?

So I have an C# Form application that utilizes the web browser component. Apparently Response.Write(Request.Browser.Version.ToString()); returns "7.0" when I visit my test page from the web browser component.

How can I make this web browser component use IE8?

question from:https://stackoverflow.com/questions/1786905/web-browser-component-is-ie7-not-ie8-how-to-change-this

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

1 Answer

0 votes
by (71.8m points)

It appears you need to fiddle with the registry as per this article: -

http://blogs.msdn.com/ie/archive/2009/03/10/more-ie8-extensibility-improvements.aspx

To run a WebBrowser control in IE8 Standards Mode, use the following new value into the registry:

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)SoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION] 
"MyApplication.exe" = dword 8000 (Hex: 0x1F40)

To run in IE7 Standards Mode, use the following registry value:

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)SoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION] 
"MyApplication.exe" = dword 7000 (Hex: 0x1B58)

For IE8 RTM, we’ve added a new “forced” IE8 Standards Mode value. When an application opts into this mode, the Web Browser control will use the IE8 User-Agent string and Browser Emulation mode strictly. It will also ignore fallback features such as the built-in Compatibility View list and the user-generated Compatibility View list when loading pages. To run in “forced” IE8 Standards Mode, use the following registry value:

[(HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE)SoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION] 
"MyApplication.exe" = dword 8888 (Hex: 0x22B8)

In all of these examples, “MyApplication.exe” refers to the name of your application.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...