This is a really nice one:
http://snipplr.com/view/10315/[
^]
But first of all read this:
http://www.csharphelp.com/2007/01/registry-ins-and-outs-using-c/[
^]
You need recursivity and this code snippet found by google for you will help also:
private void GetSubKeys(RegistryKey SubKey)
{
foreach(string sub in SubKey.GetSubKeyNames())
{
RegistryKey local = Registry.Users;
local = SubKey.OpenSubKey(sub,true);
GetSubKeys(local);
}
}
RegistryKey OurKey = Registry.Users;
OurKey = OurKey.OpenSubKey(@".DEFAULT\test",true);
GetSubKeys(OurKey);