PDA

View Full Version : Registry.GetValeu question with (default)


Solmos
03-24-2008, 02:38 AM
Hello

What could distinguish when accessing the values of a Key, between the default value (AMS7 returns (Default)) and a value in the same key that call (Default).

How could know what the default value?

thx

Lorne
03-24-2008, 11:27 AM
A "(Default)" value in the Registry doesn't actually have any name (it's an empty string), it just shows up as "(Default)" in regedit. So a value with the name "(Default)" and the actual default value for the key are automatically different.

jassing
03-24-2008, 11:41 AM
Hello

What could distinguish when accessing the values of a Key, between the default value (AMS7 returns (Default)) and a value in the same key that call (Default).

How could know what the default value?

thx

To add to what Lorne said, to get the Default value:

Registry.GetValue(nHive, cKey, "");

and (IR did a super job on...) the help file shows:

Note: To get the "(Default)" value's data, use an empty string "" as the value name.