Bewerken

Share via


RegistryKey.GetAccessControl Method

Definition

Returns the access control security for the current registry key.

Overloads

GetAccessControl()

Returns the access control security for the current registry key.

GetAccessControl(AccessControlSections)

Returns the specified sections of the access control security for the current registry key.

GetAccessControl()

Source:
RegistryKey.cs

Returns the access control security for the current registry key.

public:
 System::Security::AccessControl::RegistrySecurity ^ GetAccessControl();
public System.Security.AccessControl.RegistrySecurity GetAccessControl ();
member this.GetAccessControl : unit -> System.Security.AccessControl.RegistrySecurity
Public Function GetAccessControl () As RegistrySecurity

Returns

An object that describes the access control permissions on the registry key represented by the current RegistryKey.

Exceptions

The user does not have the necessary permissions.

The RegistryKey being manipulated is closed (closed keys cannot be accessed).

The current key has been deleted.

Remarks

This method overload is equivalent to calling the GetAccessControl(AccessControlSections) method overload with the bitwise combination of the following flags: AccessControlSections.Access, AccessControlSections.Owner, and AccessControlSections.Group. You can use that overload to search for other permissions.

The user must have RegistryRights.ReadPermissions rights to call this method.

Applies to

GetAccessControl(AccessControlSections)

Source:
RegistryKey.cs

Returns the specified sections of the access control security for the current registry key.

public:
 System::Security::AccessControl::RegistrySecurity ^ GetAccessControl(System::Security::AccessControl::AccessControlSections includeSections);
public System.Security.AccessControl.RegistrySecurity GetAccessControl (System.Security.AccessControl.AccessControlSections includeSections);
member this.GetAccessControl : System.Security.AccessControl.AccessControlSections -> System.Security.AccessControl.RegistrySecurity
Public Function GetAccessControl (includeSections As AccessControlSections) As RegistrySecurity

Parameters

includeSections
AccessControlSections

A bitwise combination of enumeration values that specifies the type of security information to get.

Returns

An object that describes the access control permissions on the registry key represented by the current RegistryKey.

Exceptions

The user does not have the necessary permissions.

The RegistryKey being manipulated is closed (closed keys cannot be accessed).

The current key has been deleted.

Remarks

To request the access permissions currently granted to users, specify the bitwise combination of the following flags: AccessControlSections.Access, AccessControlSections.Owner, and AccessControlSections.Group. Alternatively, you can use the GetAccessControl() method overload, which specifies exactly that combination of values.

The user must have RegistryRights.ReadPermissions rights to call this method.

Applies to