RegistryKey::Handle Property
.NET Framework (current version)
Gets a SafeRegistryHandle object that represents the registry key that the current RegistryKey object encapsulates.
Assembly: mscorlib (in mscorlib.dll)
public: [ComVisibleAttribute(false)] property SafeRegistryHandle^ Handle { [SecurityCriticalAttribute] [SecurityPermissionAttribute(SecurityAction::Demand, Flags = SecurityPermissionFlag::UnmanagedCode)] SafeRegistryHandle^ get(); }
Property Value
Type: Microsoft.Win32.SafeHandles::SafeRegistryHandle^The handle to the registry key.
| Exception | Condition |
|---|---|
| ObjectDisposedException | The registry key is closed. Closed keys cannot be accessed. |
| UnauthorizedAccessException | The user does not have the necessary registry rights. |
| IOException | A system error occurred, such as deletion of the current key. |
| SecurityException | The user does not have the permissions required to read the key. |
SecurityCriticalAttributeSecurityPermission
Requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
for the ability to access the specified registry key if it is a remote key. Associated enumeration: SecurityPermissionFlag::UnmanagedCode
.NET Framework
Available since 4.0
Available since 4.0
Show: