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
Binary

Binary data in any form. This value is equivalent to the Win32 API registry data type REG_BINARY.

DWord

A 32-bit binary number. This value is equivalent to the Win32 API registry data type REG_DWORD.

ExpandString

A 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.

MultiString

An array of null-terminated strings, terminated by two null characters. This value is equivalent to the Win32 API registry data type REG_MULTI_SZ.

None

No data type.

QWord

A 64-bit binary number. This value is equivalent to the Win32 API registry data type REG_QWORD.

String

A null-terminated string. This value is equivalent to the Win32 API registry data type REG_SZ.

Unknown

An 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
Available since 2.0
Return to top
Show: