RegistryKey Methods

The RegistryKey type exposes the following members.

  Name Description
Public method Close Closes the key and flushes it to disk if its contents have been modified.
Public method CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method CreateSubKey(String) Creates a new subkey or opens an existing subkey for write access.
Public method CreateSubKey(String, RegistryKeyPermissionCheck) Creates a new subkey or opens an existing subkey for write access, using the specified permission check option.
Public method CreateSubKey(String, Boolean) Creates a new subkey or opens an existing subkey with the specified access. Available starting in .NET Framework 2015
Public method CreateSubKey(String, RegistryKeyPermissionCheck, RegistryOptions) Creates a subkey or opens a subkey for write access, using the specified permission check and registry options.
Public method CreateSubKey(String, RegistryKeyPermissionCheck, RegistrySecurity) Creates a new subkey or opens an existing subkey for write access, using the specified permission check option and registry security.
Public method CreateSubKey(String, Boolean, RegistryOptions) Creates a new subkey or opens an existing subkey with the specified access. Available starting in .NET Framework 2015
Public method CreateSubKey(String, RegistryKeyPermissionCheck, RegistryOptions, RegistrySecurity) Creates a subkey or opens a subkey for write access, using the specified permission check option, registry option, and registry security.
Public method DeleteSubKey(String) Deletes the specified subkey.
Public method DeleteSubKey(String, Boolean) Deletes the specified subkey, and specifies whether an exception is raised if the subkey is not found.
Public method DeleteSubKeyTree(String) Deletes a subkey and any child subkeys recursively.
Public method DeleteSubKeyTree(String, Boolean) Deletes the specified subkey and any child subkeys recursively, and specifies whether an exception is raised if the subkey is not found.
Public method DeleteValue(String) Deletes the specified value from this key.
Public method DeleteValue(String, Boolean) Deletes the specified value from this key, and specifies whether an exception is raised if the value is not found.
Public method Dispose Releases all resources used by the current instance of the RegistryKey class.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method Flush Writes all the attributes of the specified open registry key into the registry.
Public method Static member FromHandle(SafeRegistryHandle) Creates a registry key from a specified handle.
Public method Static member FromHandle(SafeRegistryHandle, RegistryView) Creates a registry key from a specified handle and registry view setting.
Public method GetAccessControl() Returns the access control security for the current registry key.
Public method GetAccessControl(AccessControlSections) Returns the specified sections of the access control security for the current registry key.
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method GetSubKeyNames Retrieves an array of strings that contains all the subkey names.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method GetValue(String) Retrieves the value associated with the specified name. Returns null if the name/value pair does not exist in the registry.
Public method GetValue(String, Object) Retrieves the value associated with the specified name. If the name is not found, returns the default value that you provide.
Public method GetValue(String, Object, RegistryValueOptions) Retrieves the value associated with the specified name and retrieval options. If the name is not found, returns the default value that you provide.
Public method GetValueKind Retrieves the registry data type of the value associated with the specified name.
Public method GetValueNames Retrieves an array of strings that contains all the value names associated with this key.
Public method InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method Static member OpenBaseKey Opens a new RegistryKey that represents the requested key on the local machine with the specified view.
Public method Static member OpenRemoteBaseKey(RegistryHive, String) Opens a new RegistryKey that represents the requested key on a remote machine.
Public method Static member OpenRemoteBaseKey(RegistryHive, String, RegistryView) Opens a new registry key that represents the requested key on a remote machine with the specified view.
Public method OpenSubKey(String) Retrieves a subkey as read-only.
Public method OpenSubKey(String, RegistryKeyPermissionCheck) Retrieves the specified subkey for read or read/write access.
Public method OpenSubKey(String, Boolean) Retrieves a specified subkey, and specifies whether write access is to be applied to the key.
Public method OpenSubKey(String, RegistryRights) Retrieves a subkey with the specified name and .Available starting in .NET Framework 2015
Public method OpenSubKey(String, RegistryKeyPermissionCheck, RegistryRights) Retrieves the specified subkey for read or read/write access, requesting the specified access rights.
Public method SetAccessControl Applies Windows access control security to an existing registry key.
Public method SetValue(String, Object) Sets the specified name/value pair.
Public method SetValue(String, Object, RegistryValueKind) Sets the value of a name/value pair in the registry key, using the specified registry data type.
Public method ToString Retrieves a string representation of this key. (Overrides Object.ToString().)
Top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft