Export (0) Print
Expand All

RegistryValueKind Enumeration

Specifies the data types to use when storing values in the registry, or identifies the data type of a value in the registry.

Namespace:  Microsoft.Win32
Assembly:  mscorlib (in mscorlib.dll)

[<ComVisibleAttribute(true)>]
type RegistryValueKind

Member nameDescription
BinaryBinary data in any form. This value is equivalent to the Win32 API registry data type REG_BINARY.
DWordA 32-bit binary number. This value is equivalent to the Win32 API registry data type REG_DWORD.
ExpandStringA null-terminated string that contains unexpanded references to environment variables, such as %PATH%, that are expanded when the value is retrieved. This value is equivalent to the Win32 API registry data type REG_EXPAND_SZ.
MultiStringAn array of null-terminated strings, terminated by two null characters. This value is equivalent to the Win32 API registry data type REG_MULTI_SZ.
NoneNo data type.
QWordA 64-bit binary number. This value is equivalent to the Win32 API registry data type REG_QWORD.
StringA null-terminated string. This value is equivalent to the Win32 API registry data type REG_SZ.
UnknownAn unsupported registry data type. For example, the Microsoft Win32 API registry data type REG_RESOURCE_LIST is unsupported. Use this value to specify that the SetValue method should determine the appropriate registry data type when storing a name/value pair.

The RegistryValueKind enumeration defines the set of supported registry data types and the value that is used for unsupported types (Unknown). Starting in the .NET Framework 4, you can specify not to use a data type with the None value.

Use the RegistryKey.GetValueKind method to determine the data type of a registry key value before retrieving the value. When you set a registry key value, use the SetValue method to specify the registry data type explicitly.

The following code example creates a registry key and sets several values for that key, using RegistryValueKind to specify the registry data types. The example then uses RegistryKey.GetValueKind to check the registry data types, in order to retrieve the values and display them.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft