zoukankan      html  css  js  c++  java
  • c# 通过注册表判断有没有安装某个软件

            private bool checkHasInstalledSoftWare(string displayName)
            {
                Microsoft.Win32.RegistryKey uninstallNode = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWAREMicrosoftWindowsCurrentVersionUninstall");
                foreach (string subKeyName in uninstallNode.GetSubKeyNames())
                {
                    Microsoft.Win32.RegistryKey subKey = uninstallNode.OpenSubKey(subKeyName);
                    object disName = subKey.GetValue("DisplayName");
                    if (disName != null)
                    {
                        if (disName.ToString()== displayName)
                        {
                             return true;
                            // MessageBox.Show(displayName.ToString());  
                             Debug.Print(""+displayName);//Microsoft Edge
    
                        }
                    }
                }
                return false;
            }
    

      调用:

    if (checkHasInstalledSoftWare("Microsoft Edge"))
    {
    //.......
    }
    else {
    //-----------
    }


    fffffffffffffffff
    test red font.
  • 相关阅读:
    Title
    Title
    Title
    Title
    Title
    Title
    Title
    get和post两种表单提交方式的区别
    计算机网络体系结构补充内容
    计算机网络体系结构作业题整理-第十章答案
  • 原文地址:https://www.cnblogs.com/wgscd/p/14393628.html
Copyright © 2011-2022 走看看