RegistryKey key =
Regitstry.LocalMachine.OpenSubKey(@"Software\Autodesk\Revit\Autodesk Revit
Architecture 2010")
It returns null. I'm sure this is due to a fundamental misunderstanding on
my part. Could someone set me straight. Thanks.
private string GetSubKeyValue(string regPathKey, string subkeyName,
string valueName)
{
try
{
using (RegistryKey key =
Registry.LocalMachine.OpenSubKey(regPathKey)) //key is null
using (RegistryKey subKey = key.OpenSubKey(subkeyName))
{
string val = subKey.GetValue(valueName) as string;
if (val == null) { return string.Empty;}
else { return val; }
}
}
catch
{
return string.Empty;
}
}
--
Bobby C. Jones
http://bobbycjones.spaces.live.com