C# 如何判断ie版本号和获取注册表中的信息
1.获取ie版本号
1 string ver = (new WebBrowser()).Version.ToString();
例如:11.0.10586.103
1 int mainVer = (new WebBrowser()).Version.Major;
例如:11
2.获取注册表信息
方法一:
1 RegistryKey mainKey = Microsoft.Win32.Registry.LocalMachine; 2 RegistryKey subKey = mainKey.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer"); 3 object value = subKey.GetValue("Version");
方法二:
1 object value = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer").GetValue("Version").ToString();