How to get IE version info in Winform? [duplicate]
Asked Answered
S

4

9

I am developing an winform application in .NET framework 3.5, using C#.

In the application I need to display the IE version number, installed on the machine on which it runs. How can I do that, can anybody tell me?

Stuartstub answered 1/6, 2011 at 7:41 Comment(0)
P
18

You can read the version from the registry:

var ieVersion = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Internet Explorer").GetValue("Version");
Prosser answered 1/6, 2011 at 7:47 Comment(5)
Sorry Alex Aza, I am new to Stack Overflow, so I was not aware of that. Thanks for your help, it solved my problem. :)Stuartstub
@Stuartstub - no problem. Welcome aboard!Prosser
Warning: The format of this string might not be what you expect. 9.10 is IE10 and 9.11 is IE11.Whizbang
Also you may want to use 'svcVersion' instead of 'Version'. For IE 10 and 11 it shows right version (as in about) and for versions below it has same value as 'Version'.Ferguson
string ver = (new WebBrowser()).Version.ToString();Sere
J
9

With Windows 8 you should use the "svcVersion" rather than the "Version" key. Otherwise it will report that IE 9 is installed instead of IE 10. Possibly also the case with Windows 7 if you have upgraded to IE10 (I have IE 9 installed so I can't say for sure).

Juridical answered 1/5, 2013 at 0:6 Comment(0)
O
4

I think this may help:

private string GetIEVersion()
{
    string key = @"Software\Microsoft\Internet Explorer";
    RegistryKey dkey = Registry.LocalMachine.OpenSubKey(key, false);
    string data = dkey.GetValue("Version").ToString();
    return data;
}
Outrun answered 1/6, 2011 at 7:59 Comment(0)
G
1

Look at HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Version registry key

Gailgaile answered 1/6, 2011 at 7:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.