Retrieves the value associated with the specified name. Returns null if the name/value pair does not exist in the registry.
The value associated with name, or null if name is not found.
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.
When the RegistryKey.GetValue(string) method retrieves expandable string values (RegistryValueKind.ExpandString), it expands environment strings using data from the local environment. To retrieve expandable string values from the registry on a remote computer, use the RegistryKey.GetValue(string, object, RegistryValueOptions) method overload to specify that you do not want environment strings expanded.
If a value containing expandable references to environment variables has been stored as a string (RegistryValueKind.String), rather than as an expandable string (RegistryValueKind.ExpandString), RegistryKey.GetValue(string) does not expand it. You can expand such a string after it has been retrieved by calling the Environment.ExpandEnvironmentVariables(string) method.
The recommended way to retrieve data from the Registry.PerformanceData key is to use the System.Diagnostics.PerformanceCounter class rather than the erload:Microsoft.Win32.RegistryKey.GetValue method.
RegistryKey.GetValue(string) 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.