LanguagePreferences.GetBooleanValue(RegistryKey, String, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Obtains a boolean value from the specified registry entry.
public:
bool GetBooleanValue(Microsoft::Win32::RegistryKey ^ key, System::String ^ name, bool def);
public:
bool GetBooleanValue(Microsoft::Win32::RegistryKey ^ key, Platform::String ^ name, bool def);
bool GetBooleanValue(Microsoft::Win32::RegistryKey const & key, std::wstring const & name, bool def);
public bool GetBooleanValue (Microsoft.Win32.RegistryKey key, string name, bool def);
member this.GetBooleanValue : Microsoft.Win32.RegistryKey * string * bool -> bool
Public Function GetBooleanValue (key As RegistryKey, name As String, def As Boolean) As Boolean
Parameters
- key
- RegistryKey
[in] The RegistryKey object representing the desired registry subkey.
- name
- String
[in] The name of the registry entry for which to get the value.
- def
- Boolean
[in] The default value to use if the registry entry is not found.
Returns
rue
if the registry entry exists and contains a non-zero value or the word "True" (case-insensitive comparison), false
if the registry entry exists and contains a zero value or the word "False" (case-insensitive comparison). Otherwise, returns the default value specified in def
. Note: if the registry entry is a string, then any string other than "True" or "False" throws a FormatException.
Remarks
This is a helper method used for obtaining boolean values from the registry. It is typically called from the InitMachinePreferences method.