• c# webbrowser控件内核版本强制修改


                int BrowserVer, RegVal;
    
                // get the installed IE version
                using (WebBrowser Wb = new WebBrowser())
                    BrowserVer = Wb.Version.Major;
    
                // set the appropriate IE version
                if (BrowserVer >= 11)
                    RegVal = 11001;
                else if (BrowserVer == 10)
                    RegVal = 10001;
                else if (BrowserVer == 9)
                    RegVal = 9999;
                else if (BrowserVer == 8)
                    RegVal = 8888;
                else
                    RegVal = 7000;
    
                // set the actual key
                RegistryKey Key = Registry.CurrentUser.OpenSubKey(@"SOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION", true);
    // 64位的时候key为空所以重新创建一个 if (Key == null) { RegistryKey Key2 = Registry.CurrentUser.OpenSubKey (@"SOFTWAREMicrosoftInternet ExplorerMainFeatureControl", true); Key = Key2.CreateSubKey("FEATURE_BROWSER_EMULATION"); } Key.SetValue(System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".exe", RegVal, RegistryValueKind.DWord); Key.Close();

      

  • 相关阅读:
    缓存Cache
    RDD的行动操作
    redis数据库的配置
    requests的封装(user-agent,proxies)
    phantjs
    python多线程
    etree-xpath
    Flask
    Flask
    Flask
  • 原文地址:https://www.cnblogs.com/c-x-a/p/6401374.html
Copyright © 2020-2023  润新知