RegistryKey.Handle Property

.NET Framework (current version)
 

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

Namespace:   Microsoft.Win32
Assembly:  mscorlib (in mscorlib.dll)

[ComVisibleAttribute(false)]
public SafeRegistryHandle Handle {
	[SecurityCriticalAttribute]
	[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
	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.

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: SecurityPermissionFlag.UnmanagedCode

.NET Framework
Available since 4.0
Return to top
Show: