如何在Winform中获取IE版本信息?

我正在使用C#在.NET framework 3.5中开发一个winform应用程序。

在应用程序中,我需要显示安装在运行它的机器上的IE版本号。 我怎么能这样做,谁能告诉我?

您可以从注册表中读取该版本:

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

对于Windows 8,您应该使用“svcVersion”而不是“Version”键。 否则它将报告安装了IE 9而不是IE 10.如果你已经升级到IE10(Windows I已经安装了IE 9,所以我不能肯定地说),也可能是Windows 7的情况。

我认为这可能会有所帮助:

 private string GetIEVersion() { string key = @"Software\Microsoft\Internet Explorer"; RegistryKey dkey = Registry.LocalMachine.OpenSubKey(key, false); string data = dkey.GetValue("Version").ToString(); return data; } 

查看HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Internet Explorer \ Version注册表项