Search code examples
c#registrycatalog

Get sub-catalogs from registry


Can someone suggest good way, how to get all subcategories from the registry?

Example: I have HKEY_CURRENT_USER\\AnyName\\ in the registry and there are some catalogs so how to get list all of them in string?


Solution

  • I am not totally sure I understand your question but if you want the sub key names you can do:

    string[] subKeyNames = Registry.CurrentUser.OpenSubKey("AnyName").GetSubKeyNames();
    

    There are lots of examples on the web for using the Registry class - also MSDN has some samples and explanations.