Answer the question
In order to leave comments, you need to log in
How to get an array of all subkeys of a Windows registry key in C#?
So, at the moment, the functionality of my program looks like this:
treeView_registryKeys.Nodes.Add(new TreeNode("Computer"));
RegistryKey[] regKeyArray = new RegistryKey[] { Registry.ClassesRoot,
Registry.CurrentUser,
Registry.LocalMachine,
Registry.Users,
Registry.CurrentConfig
};
foreach (RegistryKey key in regKeyArray)
{
TreeNode node = new TreeNode() { Name = "node", Text = key.ToString() };
treeView.FindNodeByName(treeView_registryKeys.Nodes[0], "Computer").Nodes.Add(node);
}
String[] regClassesRootKeyArray = new String[1000];
regClassesRootKeyArray = Registry.ClassesRoot.GetSubKeyNames();
foreach (String subKey in regClassesRootKeyArray)
{
TreeNode node = new TreeNode() { Name = "node", Text = subKey };
treeView.FindNodeByName(treeView_registryKeys.Nodes[0], "HKEY_CLASSES_ROOT").Nodes.Add(node);
}
Registry.[root registry key name].GetSubKeyNames()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question