Retrieves the value associated with the specified name and retrieval options. If the name is not found, returns the default value that you provide.
The value associated with name, processed according to the specified options, or defaultValue if name is not found.
Use this overload to specify special processing of the retrieved value. For example, you can specify RegistryValueOptions.DoNotExpandEnvironmentNames when retrieving a registry value of type RegistryValueKind.ExpandString to retrieve the string without expanding embedded environment variables.
Use the defaultValue parameter to specify the value to return if name does not exist.
A registry key can have one value that is not associated with any name. When this unnamed value is displayed in the registry editor, the string "(Default)" appears instead of a name. To retrieve this unnamed value, specify either null or the empty string ("") for name.
RegistryKey.GetValue(string, object, RegistryValueOptions) does not support reading values of type REG_NONE or REG_LINK. In both cases, the default value (null) is returned instead of the actual value.