Microsoft.Win32.Registry
Provides objects that represent the root keys in the Windows registry, and static methods to access key/value pairs.
Defines the types (or classes) of documents and the properties associated with those types. This field reads the Windows registry base key HKEY_CLASSES_ROOT.
Contains configuration information pertaining to the hardware that is not specific to the user. This field reads the Windows registry base key HKEY_CURRENT_CONFIG.
Contains information about the current user preferences. This field reads the Windows registry base key HKEY_CURRENT_USER
Retrieves the value associated with the specified name, in the specified registry key. If the name is not found in the specified key, returns a default value that you provide, or null if the specified key does not exist.
null if the subkey specified by does not exist; otherwise, the value associated with , or if is not found.
The full registry path of the key, beginning with a valid registry root, such as "HKEY_CURRENT_USER".
The name of the name/value pair.
The value to return if does not exist.
The user does not have the permissions required to read from the registry key.
The that contains the specified value has been marked for deletion.
does not begin with a valid registry root.
Contains the configuration data for the local machine. This field reads the Windows registry base key HKEY_LOCAL_MACHINE.
Contains performance information for software components. This field reads the Windows registry base key HKEY_PERFORMANCE_DATA.
Sets the specified name/value pair on the specified registry key. If the specified key does not exist, it is created.
The full registry path of the key, beginning with a valid registry root, such as "HKEY_CURRENT_USER".
The name of the name/value pair.
The value to be stored.
is null.
does not begin with a valid registry root. -or- is longer than the maximum length allowed (255 characters).
The is read-only, and thus cannot be written to; for example, it is a root-level node.
The user does not have the permissions required to create or modify registry keys.
Sets the name/value pair on the specified registry key, using the specified registry data type. If the specified key does not exist, it is created.
The full registry path of the key, beginning with a valid registry root, such as "HKEY_CURRENT_USER".
The name of the name/value pair.
The value to be stored.
The registry data type to use when storing the data.
is null.
does not begin with a valid registry root.-or- is longer than the maximum length allowed (255 characters).-or- The type of did not match the registry data type specified by , therefore the data could not be converted properly.
The is read-only, and thus cannot be written to; for example, it is a root-level node, or the key has not been opened with write access.
The user does not have the permissions required to create or modify registry keys.
Contains information about the default user configuration. This field reads the Windows registry base key HKEY_USERS.
Represents the possible values for a top-level node on a foreign machine.
Represents the HKEY_CLASSES_ROOT base key on another computer. This value can be passed to the method, to open this node remotely.
Represents the HKEY_CURRENT_CONFIG base key on another computer. This value can be passed to the method, to open this node remotely.
Represents the HKEY_CURRENT_USER base key on another computer. This value can be passed to the method, to open this node remotely.
Represents the HKEY_LOCAL_MACHINE base key on another computer. This value can be passed to the method, to open this node remotely.
Represents the HKEY_PERFORMANCE_DATA base key on another computer. This value can be passed to the method, to open this node remotely.
Represents the HKEY_USERS base key on another computer. This value can be passed to the method, to open this node remotely.
Represents a key-level node in the Windows registry. This class is a registry encapsulation.
Creates a new subkey or opens an existing subkey for write access.
The newly created subkey, or null if the operation failed. If a zero-length string is specified for , the current object is returned.
The name or path of the subkey to create or open. This string is not case-sensitive.
is null.
The user does not have the permissions required to create or open the registry key.
The on which this method is being invoked is closed (closed keys cannot be accessed).
The cannot be written to; for example, it was not opened as a writable key , or the user does not have the necessary access rights.
The nesting level exceeds 510.-or-A system error occurred, such as deletion of the key, or an attempt to create a key in the root.
Creates a new subkey or opens an existing subkey with the specified access. Available starting in .NET Framework 2015
The newly created subkey, or null if the operation failed. If a zero-length string is specified for , the current object is returned.
The name or path of the subkey to create or open. This string is not case-sensitive.
true to indicate the new subkey is writable; otherwise, false.
is null.
The user does not have the permissions required to create or open the registry key.
The current cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights.
The nesting level exceeds 510.-or-A system error occurred, such as deletion of the key, or an attempt to create a key in the root.
Creates a new subkey or opens an existing subkey with the specified access. Available starting in .NET Framework 2015
The newly created subkey, or null if the operation failed. If a zero-length string is specified for , the current object is returned.
The name or path of the subkey to create or open. This string is not case-sensitive.
true to indicate the new subkey is writable; otherwise, false.
The registry option to use.
is null.
does not specify a valid Option
The user does not have the permissions required to create or open the registry key.
The current cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights.
The nesting level exceeds 510.-or-A system error occurred, such as deletion of the key, or an attempt to create a key in the root.
Deletes the specified subkey.
The name of the subkey to delete. This string is not case-sensitive.
The has child subkeys
The parameter does not specify a valid registry key
is null
The user does not have the permissions required to delete the key.
The being manipulated is closed (closed keys cannot be accessed).
The user does not have the necessary registry rights.
Deletes the specified subkey, and specifies whether an exception is raised if the subkey is not found.
The name of the subkey to delete. This string is not case-sensitive.
Indicates whether an exception should be raised if the specified subkey cannot be found. If this argument is true and the specified subkey does not exist, an exception is raised. If this argument is false and the specified subkey does not exist, no action is taken.
has child subkeys.
does not specify a valid registry key, and is true.
is null.
The user does not have the permissions required to delete the key.
The being manipulated is closed (closed keys cannot be accessed).
The user does not have the necessary registry rights.
Deletes a subkey and any child subkeys recursively.
The subkey to delete. This string is not case-sensitive.
is null.
Deletion of a root hive is attempted.-or- does not specify a valid registry subkey.
An I/O error has occurred.
The user does not have the permissions required to delete the key.
The being manipulated is closed (closed keys cannot be accessed).
The user does not have the necessary registry rights.
Deletes the specified subkey and any child subkeys recursively, and specifies whether an exception is raised if the subkey is not found.
The name of the subkey to delete. This string is not case-sensitive.
Indicates whether an exception should be raised if the specified subkey cannot be found. If this argument is true and the specified subkey does not exist, an exception is raised. If this argument is false and the specified subkey does not exist, no action is taken.
An attempt was made to delete the root hive of the tree.-or- does not specify a valid registry subkey, and is true.
is null.
The is closed (closed keys cannot be accessed).
The user does not have the necessary registry rights.
The user does not have the permissions required to delete the key.
Deletes the specified value from this key.
The name of the value to delete.
is not a valid reference to a value.
The user does not have the permissions required to delete the value.
The being manipulated is closed (closed keys cannot be accessed).
The being manipulated is read-only.
Deletes the specified value from this key, and specifies whether an exception is raised if the value is not found.
The name of the value to delete.
Indicates whether an exception should be raised if the specified value cannot be found. If this argument is true and the specified value does not exist, an exception is raised. If this argument is false and the specified value does not exist, no action is taken.
is not a valid reference to a value and is true. -or- is null.
The user does not have the permissions required to delete the value.
The being manipulated is closed (closed keys cannot be accessed).
The being manipulated is read-only.
Releases all resources used by the current instance of the class.
Writes all the attributes of the specified open registry key into the registry.
[SECURITY CRITICAL] Creates a registry key from a specified handle.
A registry key.
The handle to the registry key.
[SECURITY CRITICAL] Creates a registry key from a specified handle and registry view setting.
A registry key.
The handle to the registry key.
The registry view to use.
Retrieves an array of strings that contains all the subkey names.
An array of strings that contains the names of the subkeys for the current key.
The user does not have the permissions required to read from the key.
The being manipulated is closed (closed keys cannot be accessed).
The user does not have the necessary registry rights.
A system error occurred, for example the current key has been deleted.
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 , or null if is not found.
The name of the value to retrieve. This string is not case-sensitive.
The user does not have the permissions required to read from the registry key.
The that contains the specified value is closed (closed keys cannot be accessed).
The that contains the specified value has been marked for deletion.
The user does not have the necessary registry rights.
Retrieves the value associated with the specified name. If the name is not found, returns the default value that you provide.
The value associated with , with any embedded environment variables left unexpanded, or if is not found.
The name of the value to retrieve. This string is not case-sensitive.
The value to return if does not exist.
The user does not have the permissions required to read from the registry key.
The that contains the specified value is closed (closed keys cannot be accessed).
The that contains the specified value has been marked for deletion.
The user does not have the necessary registry rights.
Retrieves the value associated with the specified name and retrieval options. If the name is not found, returns the default value that you provide.
The value associated with , processed according to the specified , or if is not found.
The name of the value to retrieve. This string is not case-sensitive.
The value to return if does not exist.
One of the enumeration values that specifies optional processing of the retrieved value.
The user does not have the permissions required to read from the registry key.
The that contains the specified value is closed (closed keys cannot be accessed).
The that contains the specified value has been marked for deletion.
is not a valid value; for example, an invalid value is cast to .
The user does not have the necessary registry rights.
Retrieves the registry data type of the value associated with the specified name.
The registry data type of the value associated with .
The name of the value whose registry data type is to be retrieved. This string is not case-sensitive.
The user does not have the permissions required to read from the registry key.
The that contains the specified value is closed (closed keys cannot be accessed).
The subkey that contains the specified value does not exist.-or-The name/value pair specified by does not exist.This exception is not thrown on Windows 95, Windows 98, or Windows Millennium Edition.
The user does not have the necessary registry rights.
Retrieves an array of strings that contains all the value names associated with this key.
An array of strings that contains the value names for the current key.
The user does not have the permissions required to read from the registry key.
The being manipulated is closed (closed keys cannot be accessed).
The user does not have the necessary registry rights.
A system error occurred; for example, the current key has been deleted.
[SECURITY CRITICAL] Gets a object that represents the registry key that the current object encapsulates.
The handle to the registry key.
Retrieves the name of the key.
The absolute (qualified) name of the key.
The is closed (closed keys cannot be accessed).
Opens a new that represents the requested key on the local machine with the specified view.
The requested registry key.
The HKEY to open.
The registry view to use.
or is invalid.
The user does not have the necessary registry rights.
The user does not have the permissions required to perform this action.
Retrieves a subkey as read-only.
The subkey requested, or null if the operation failed.
The name or path of the subkey to open as read-only.
is null
The is closed (closed keys cannot be accessed).
The user does not have the permissions required to read the registry key.
Retrieves a specified subkey, and specifies whether write access is to be applied to the key.
The subkey requested, or null if the operation failed.
Name or path of the subkey to open.
Set to true if you need write access to the key.
is null.
The is closed (closed keys cannot be accessed).
The user does not have the permissions required to access the registry key in the specified mode.
Retrieves a subkey with the specified name and .Available starting in .NET Framework 2015
The subkey requested, or null if the operation failed.
The name or path of the subkey to create or open.
The rights for the registry key.
is null.
The is closed (closed keys cannot be accessed).
The user does not have the permissions required to access the registry key in the specified mode.
Sets the specified name/value pair.
The name of the value to store.
The data to be stored.
is null.
is an unsupported data type.
The that contains the specified value is closed (closed keys cannot be accessed).
The is read-only, and cannot be written to; for example, the key has not been opened with write access. -or-The object represents a root-level node, and the operating system is Windows Millennium Edition or Windows 98.
The user does not have the permissions required to create or modify registry keys.
The object represents a root-level node, and the operating system is Windows 2000, Windows XP, or Windows Server 2003.
Sets the value of a name/value pair in the registry key, using the specified registry data type.
The name of the value to be stored.
The data to be stored.
The registry data type to use when storing the data.
is null.
The type of did not match the registry data type specified by , therefore the data could not be converted properly.
The that contains the specified value is closed (closed keys cannot be accessed).
The is read-only, and cannot be written to; for example, the key has not been opened with write access.-or-The object represents a root-level node, and the operating system is Windows Millennium Edition or Windows 98.
The user does not have the permissions required to create or modify registry keys.
The object represents a root-level node, and the operating system is Windows 2000, Windows XP, or Windows Server 2003.
Retrieves the count of subkeys of the current key.
The number of subkeys of the current key.
The user does not have read permission for the key.
The being manipulated is closed (closed keys cannot be accessed).
The user does not have the necessary registry rights.
A system error occurred, for example the current key has been deleted.
Retrieves a string representation of this key.
A string representing the key. If the specified key is invalid (cannot be found) then null is returned.
The being accessed is closed (closed keys cannot be accessed).
Retrieves the count of values in the key.
The number of name/value pairs in the key.
The user does not have read permission for the key.
The being manipulated is closed (closed keys cannot be accessed).
The user does not have the necessary registry rights.
A system error occurred, for example the current key has been deleted.
Gets the view that was used to create the registry key.
The view that was used to create the registry key.-or-, if no view was used.
Specifies options to use when creating a registry key.
A non-volatile key. This is the default.
A volatile key. The information is stored in memory and is not preserved when the corresponding registry hive is unloaded.
Specifies the data types to use when storing values in the registry, or identifies the data type of a value in the registry.
Binary data in any form. This value is equivalent to the Win32 API registry data type REG_BINARY.
A 32-bit binary number. This value is equivalent to the Win32 API registry data type REG_DWORD.
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.
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.
No data type.
A 64-bit binary number. This value is equivalent to the Win32 API registry data type REG_QWORD.
A null-terminated string. This value is equivalent to the Win32 API registry data type REG_SZ.
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 method should determine the appropriate registry data type when storing a name/value pair.
Specifies optional behavior when retrieving name/value pairs from a registry key.
A value of type is retrieved without expanding its embedded environment variables.
No optional behavior is specified.
Specifies which registry view to target on a 64-bit operating system.
The default view.
The 32-bit view.
The 64-bit view.
[SECURITY CRITICAL] Represents a safe handle to the Windows registry.
[SECURITY CRITICAL] Initializes a new instance of the class.
An object that represents the pre-existing handle to use.
true to reliably release the handle during the finalization phase; false to prevent reliable release.
Specifies the access control rights that can be applied to registry objects.
The right to change the access rules and audit rules associated with a registry key.
Reserved for system use.
The right to create subkeys of a registry key.
The right to delete a registry key.
The right to list the subkeys of a registry key.
Same as .
The right to exert full control over a registry key, and to modify its access rules and audit rules.
The right to request notification of changes on a registry key.
The right to query the name/value pairs in a registry key.
The right to query the name/value pairs in a registry key, to request notification of changes, to enumerate its subkeys, and to read its access rules and audit rules.
The right to open and copy the access rules and audit rules for a registry key.
The right to create, delete, or set name/value pairs in a registry key.
The right to change the owner of a registry key.
The right to create, delete, and set the name/value pairs in a registry key, to create or delete subkeys, to request notification of changes, to enumerate its subkeys, and to read its access rules and audit rules.