RegistryKey.Handle RegistryKey.Handle RegistryKey.Handle Property

Definition

Gets a SafeRegistryHandle object that represents the registry key that the current RegistryKey object encapsulates.

public:
 property Microsoft::Win32::SafeHandles::SafeRegistryHandle ^ Handle { Microsoft::Win32::SafeHandles::SafeRegistryHandle ^ get(); };
[System.Runtime.InteropServices.ComVisible(false)]
public Microsoft.Win32.SafeHandles.SafeRegistryHandle Handle { get; }
Public ReadOnly Property Handle As SafeRegistryHandle
Property Value

The handle to the registry key.

Exceptions

The registry key is closed. Closed keys cannot be accessed.

The user does not have the necessary registry rights.

A system error occurred, such as deletion of the current key.

The user does not have the permissions required to read the key.

Security

SecurityCriticalAttribute
Requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

SecurityPermission
for the ability to access the specified registry key if it is a remote key. Associated enumeration: UnmanagedCode

Applies to