Winform使WebBrowser使用指定版本IE内核

        /// <summary>

        /// 修改注册表信息使WebBrowser使用指定版本IE内核

        /// </summary>

        public static void SetFeatures(UInt32 ieMode)

        {

            if (LicenseManager.UsageMode != LicenseUsageMode.Runtime)

            {

                throw new ApplicationException();

            }

            //获取程序及名称

            string appName = System.IO.Path.GetFileName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);

            string featureControlRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\";

            //设置浏览器对应用程序(appName)以什么模式(ieMode)运行

            Registry.SetValue(featureControlRegKey + "FEATURE_BROWSER_EMULATION", appName, ieMode, RegistryValueKind.DWord);

            //不晓得设置有什么用

            Registry.SetValue(featureControlRegKey + "FEATURE_ENABLE_CLIPCHILDREN_OPTIMIZATION", appName, 1, RegistryValueKind.DWord);

        }