开发者

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

This question already has answers here: Detect IE version from a WinForms application (5 answers) 开发者_StackOverflow中文版 Closed 9 years ago.

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?


You can read the version from the registry:

var ieVersion = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Internet Explorer").GetValue("Version");


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).


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;
}


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜