How to search for specific value in Registry keys

后端 未结 4 750
暗喜
暗喜 2020-12-15 12:19

How can I search for specific value in the registry keys?

For example I want to search for XXX in

HKEY_CLASSES_ROOT\\Installer\\Products
         


        
4条回答
  •  一生所求
    2020-12-15 12:39

    In case you don't want to take a dependency on LogParser (as powerful as it is): I would take a look at the Microsoft.Win32.RegistryKey class (MSDN). Use OpenSubKey to open up HKEY_CLASSES_ROOT\Installer\Products, and then call GetSubKeyNames to, well, get the names of the subkeys.

    Open up each of those in turn, call GetValue for the value you're interested in (ProductName, I guess) and compare the result to what you're looking for.

提交回复
热议问题