WebBrowser management for using IE9

I want the WebBrowser control to use IE9. IE9 is installed on the computer, but the WebBrowser control still uses IE8.

I checked with http://www.whatbrowser.org/en/ . I am trying to make some changes to the registry (found a solution here) but it does not work.

+5
source share
5 answers

I think this is a user agent string passed to the site. It incorrectly identifies it as IE8, as it may not meet the requirements in its logic to conform to IE9. I see the same thing happening with my box. You can specify the user agent string to use if you want. Add this to your project.

In your usage operations add ...

using System.Runtime.InteropServices;

In your form class add ....

[DllImport("urlmon.dll", CharSet = CharSet.Ansi)]
private static extern int UrlMkSetSessionOption(int dwOption, string pBuffer, int dwBufferLength, int dwReserved);
const int URLMON_OPTION_USERAGENT = 0x10000001;

public void ChangeUserAgent(String Agent)
{
    UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, Agent, Agent.Length, 0);
}

Then just name it somewhere in your code ... perhaps a constructor or form_load event.

ChangeUserAgent("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
+7
source

" ", - . 9, 8 9 , -. . .

, DLL-. Project + Properties, Debug, tick " ". , Debug + Break All. Debug + Windows + Modules ieframe.dll . . "8.00.7600.16385 (win7_rtm.090713-1255)", Win7. IE9.

+6

HTML:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION\yourexename.exe - REG_DWORD = 9000 ()

+6

, IE -, .

I had a similar problem - more info here

+1
source

It seems this might be your script page discovery. Try the website (http://www.whatismybrowser.com/) . I know that other sites gave me the wrong information, but this site correctly identified the browser as the version of IE that was installed on my machine.

0
source

All Articles