RegistryKey.GetAccessControl 方法

定义

返回当前注册表项的访问控制安全性。Returns the access control security for the current registry key.

重载

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()

返回当前注册表项的访问控制安全性。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

返回

RegistrySecurity

一个对象,该对象描述针对由当前 RegistryKey 表示的注册表项的访问控制权限。An object that describes the access control permissions on the registry key represented by the current RegistryKey.

例外

用户没有必要的权限。The user does not have the necessary permissions.

要操作的 RegistryKey 已关闭(无法访问关闭的项)。The RegistryKey being manipulated is closed (closed keys cannot be accessed).

当前项已被删除。The current key has been deleted.

注解

此方法重载等效于调用 GetAccessControl(AccessControlSections) 具有以下标志的按位组合的方法重载: AccessControlSections.AccessAccessControlSections.OwnerAccessControlSections.GroupThis 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.

用户必须有 RegistryRights.ReadPermissions 权调用此方法。The user must have RegistryRights.ReadPermissions rights to call this method.

适用于

GetAccessControl(AccessControlSections)

返回当前注册表项的访问控制安全性的指定部分。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

参数

includeSections
AccessControlSections

枚举值的按位组合,它指定要获取的安全信息类型。A bitwise combination of enumeration values that specifies the type of security information to get.

返回

RegistrySecurity

一个对象,该对象描述针对由当前 RegistryKey 表示的注册表项的访问控制权限。An object that describes the access control permissions on the registry key represented by the current RegistryKey.

例外

用户没有必要的权限。The user does not have the necessary permissions.

要操作的 RegistryKey 已关闭(无法访问关闭的项)。The RegistryKey being manipulated is closed (closed keys cannot be accessed).

当前项已被删除。The current key has been deleted.

注解

若要请求当前授予给用户的访问权限,请指定以下标志的按位组合: AccessControlSections.AccessAccessControlSections.OwnerAccessControlSections.GroupTo request the access permissions currently granted to users, specify the bitwise combination of the following flags: AccessControlSections.Access, AccessControlSections.Owner, and AccessControlSections.Group. 或者,您可以使用 GetAccessControl() 方法重载,它指定确切的值组合。Alternatively, you can use the GetAccessControl() method overload, which specifies exactly that combination of values.

用户必须有 RegistryRights.ReadPermissions 权调用此方法。The user must have RegistryRights.ReadPermissions rights to call this method.

适用于