"AVL" <AV*@discussions.microsoft.comwrote in message
news:D5**********************************@microsof t.com...
in a console application
This is an ASP.NET newsgroup - you'll generally get better responses by
posting in the correct group...
Anyway...
given a registry key, say,"HKEY_USERS". user should be able to scan the
subkeys of the given key recursively(i.e. all the subkeys of the given
subkeys etcc..) till the last indent level....
i've used a recursion to do so..but it's taking lot of time..
is there any efficient way to acheive it.....
Dictionary<string, stringdicSubKeyNamesAndValues = new Dictionary<string,
string>();
using (RegistryKey objRegKey =
RegistryKey.OpenRemoteBaseKey(RegistryHive.Users, "<machine name>"))
{
using (RegistryKey objSubKey = objRegKey.OpenSubKey("<key to start
from">))
{
if (objSubKey!= null)
{
foreach (string strSubKey in objSubKey.GetValueNames())
{
dicSubKeyNamesAndValues.Add(strSubKey,
objRegKey.GetValue(strSubKey).ToString());
}
}
}
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net