Condividi tramite


LanguagePreferences.GetIntegerValue(RegistryKey, String, Int32) Method

Definition

Gets an integer value from the specified registry entry.

public:
 int GetIntegerValue(Microsoft::Win32::RegistryKey ^ key, System::String ^ name, int def);
public:
 int GetIntegerValue(Microsoft::Win32::RegistryKey ^ key, Platform::String ^ name, int def);
int GetIntegerValue(Microsoft::Win32::RegistryKey const & key, std::wstring const & name, int def);
public int GetIntegerValue (Microsoft.Win32.RegistryKey key, string name, int def);
member this.GetIntegerValue : Microsoft.Win32.RegistryKey * string * int -> int
Public Function GetIntegerValue (key As RegistryKey, name As String, def As Integer) As Integer

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
Int32

[in] The default value to use if the registry entry is not found.

Returns

The integer value stored in the registry entry if the registry entry exists, otherwise def if the registry entry does not exist. If the registry entry is a string, then the string is evaluated as a number.

Remarks

This is a helper method used for obtaining numerical values from the registry. It is typically called from InitMachinePreferences.

Applies to