• 设置webbrowser浏览器内核


    var hklm = Microsoft.Win32.Registry.LocalMachine;
                var lmRun64 = hklm.OpenSubKey(@"SOFTWAREWow6432NodeMicrosoftInternet ExplorerMAINFeatureControlFEATURE_BROWSER_EMULATION", true);
                var lmRun32 = hklm.OpenSubKey(@"SOFTWAREMicrosoftInternet ExplorerMAINFeatureControlFEATURE_BROWSER_EMULATION", true);
                //获取路径的方法
                string location64 = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
                string fileName64 = System.IO.Path.GetFileName(location64);
                string location32 = this.GetType().Assembly.Location;
                string fileName32 = System.IO.Path.GetFileName(location32);
                if (lmRun64 != null)
                {
                    string value64 = null;

                    var xx = lmRun64.GetValue(fileName64);
                    if (xx != null)
                    {
                        value64 = Convert.ToString(lmRun64.GetValue(fileName64));
                    }
                    if (string.IsNullOrEmpty(value64))
                    {
                        //lmRun64.SetValue("TemplateBrowser.exe", 0x2710); //设置webbrowser调用IE10内核打开
                        lmRun64.SetValue(fileName64, 0x2710); //设置webbrowser调用IE10内核打开
                        lmRun64.SetValue(fileName32, 0x2710); //设置webbrowser调用IE10内核打开
                    }

                }

                if (lmRun32 != null)
                {
                    string value32 = null;
                    var xx = lmRun32.GetValue(fileName32);
                    if (xx != null)
                    {
                        value32 = Convert.ToString(lmRun32.GetValue(fileName32));
                    }

                    if (string.IsNullOrEmpty(value32))
                    {
                        //lmRun32.SetValue("TemplateBrowser.exe", 0x2710); //设置webbrowser调用IE10内核打开
                        lmRun32.SetValue(fileName32, 0x2710); //设置webbrowser调用IE10内核打开
                        lmRun32.SetValue(fileName64, 0x2710); //设置webbrowser调用IE10内核打开
                    }
                }


                wb.Url = new Uri("http://www.dcwriter.cn/");

  • 相关阅读:
    各类 HTTP 返回状态代码详解
    ANDROID内存优化——大汇总(转)
    Process Stats:了解你的APP如何使用内存(转)
    Android开发之AlarmManager详解
    转 16 jmeter中的监听器以及测试结果分析
    转 15 jmeter分布式性能测试
    转 14 jmeter性能测试实战--数据库MySQL
    转 12 jmeter性能测试实战--web程序
    转 11 jmeter之图形监控扩展
    转 10 jmeter之动态关联
  • 原文地址:https://www.cnblogs.com/edangame/p/5468788.html
Copyright © 2020-2023  润新知