zoukankan      html  css  js  c++  java
  • 设置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/");

  • 相关阅读:
    Android Widget小组件开发(一)——Android实现时钟Widget组件的步骤开发,这些知识也是不可缺少的!
    java基础——static keyword小节
    iOS UI08_UITableView
    Android 6.0 开发人员对系统权限的使用与练习(Permissions Best Practices)
    Android简单实现BroadCastReceiver广播机制
    UI组件之TextView及其子类(一)TextView和EditText
    BZOJ 3112 [Zjoi2013]防守战线 线性规划
    反射 + 配置文件 实现IOC容器
    android:异步任务asyncTask介绍及异步任务下载图片(带进度条)
    【LeetCode-面试算法经典-Java实现】【058-Length of Last Word (最后一个单词的长度)】
  • 原文地址:https://www.cnblogs.com/edangame/p/5468788.html
Copyright © 2011-2022 走看看