Specifies the access control rights that can be applied to registry objects.
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Assembly: mscorlib (in mscorlib.dll)
|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.|
Use the enumeration to specify registry access rights when you create RegistrySecurity objects. To apply access rights to a registry key, first add RegistryAccessRule objects to a RegistrySecurity object, then attach the RegistrySecurity object to the key using the RegistryKey.SetAccessControl method, or an appropriate overload of the RegistryKey.CreateSubKey method.
The following code example demonstrates the use of the enumeration. The code creates a test key, allowing the current user and access rights but denying and rights. Subsequent attempts to manipulate the key succeed or fail depending on these permissions.
Before the key is deleted, the code pauses. You can switch to the Registry Editor (Regedit.exe or Regedt32.exe) and verify that the same access rights apply when the key is accessed using the Registry Editor.
This example works best if you use RunAs from the command line to run the Registry Editor and the sample code as a local user without administrator rights. For example, if you have defined a local user named TestUser, the command runas /user:TestUser cmd opens a command window from which you can run the Registry Editor and then the example code.
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.