人人人人人人人人人人人人

注册表判断是否安装微软Edge浏览器

自己摸索的,注册表判断是否安装微软Edge浏览器:

 

 bool checkInstalledMsEdge()
        {
            try
            {
               
                using(var ieKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe",
                    RegistryKeyPermissionCheck.ReadSubTree,
                System.Security.AccessControl.RegistryRights.QueryValues))
                {
                    var s =""+ ieKey.GetValue("Path");
                    return !string.IsNullOrEmpty(s);
                }
            }
            catch
            {
                
            }
            return false;


        }

  

posted @ 2021-04-03 14:09  wgscd  阅读(433)  评论(0编辑  收藏  举报