RegistryKey.FromHandle 方法

定义

根据指定的句柄创建注册表项。

重载

FromHandle(SafeRegistryHandle)

根据指定的句柄创建注册表项。

FromHandle(SafeRegistryHandle, RegistryView)

利用指定的句柄和注册表视图设置创建注册表项。

FromHandle(SafeRegistryHandle)

Source:
RegistryKey.cs

根据指定的句柄创建注册表项。

public:
 static Microsoft::Win32::RegistryKey ^ FromHandle(Microsoft::Win32::SafeHandles::SafeRegistryHandle ^ handle);
public static Microsoft.Win32.RegistryKey FromHandle (Microsoft.Win32.SafeHandles.SafeRegistryHandle handle);
[System.Security.SecurityCritical]
public static Microsoft.Win32.RegistryKey FromHandle (Microsoft.Win32.SafeHandles.SafeRegistryHandle handle);
[System.Security.SecurityCritical]
[System.Runtime.InteropServices.ComVisible(false)]
public static Microsoft.Win32.RegistryKey FromHandle (Microsoft.Win32.SafeHandles.SafeRegistryHandle handle);
static member FromHandle : Microsoft.Win32.SafeHandles.SafeRegistryHandle -> Microsoft.Win32.RegistryKey
[<System.Security.SecurityCritical>]
static member FromHandle : Microsoft.Win32.SafeHandles.SafeRegistryHandle -> Microsoft.Win32.RegistryKey
[<System.Security.SecurityCritical>]
[<System.Runtime.InteropServices.ComVisible(false)>]
static member FromHandle : Microsoft.Win32.SafeHandles.SafeRegistryHandle -> Microsoft.Win32.RegistryKey
Public Shared Function FromHandle (handle As SafeRegistryHandle) As RegistryKey

参数

handle
SafeRegistryHandle

注册表项的句柄。

返回

注册表项。

属性

例外

handlenull

用户没有必需的注册表权限。

用户没有执行此操作所需的权限。

适用于

FromHandle(SafeRegistryHandle, RegistryView)

Source:
RegistryKey.cs

利用指定的句柄和注册表视图设置创建注册表项。

public:
 static Microsoft::Win32::RegistryKey ^ FromHandle(Microsoft::Win32::SafeHandles::SafeRegistryHandle ^ handle, Microsoft::Win32::RegistryView view);
public static Microsoft.Win32.RegistryKey FromHandle (Microsoft.Win32.SafeHandles.SafeRegistryHandle handle, Microsoft.Win32.RegistryView view);
[System.Security.SecurityCritical]
public static Microsoft.Win32.RegistryKey FromHandle (Microsoft.Win32.SafeHandles.SafeRegistryHandle handle, Microsoft.Win32.RegistryView view);
[System.Security.SecurityCritical]
[System.Runtime.InteropServices.ComVisible(false)]
public static Microsoft.Win32.RegistryKey FromHandle (Microsoft.Win32.SafeHandles.SafeRegistryHandle handle, Microsoft.Win32.RegistryView view);
static member FromHandle : Microsoft.Win32.SafeHandles.SafeRegistryHandle * Microsoft.Win32.RegistryView -> Microsoft.Win32.RegistryKey
[<System.Security.SecurityCritical>]
static member FromHandle : Microsoft.Win32.SafeHandles.SafeRegistryHandle * Microsoft.Win32.RegistryView -> Microsoft.Win32.RegistryKey
[<System.Security.SecurityCritical>]
[<System.Runtime.InteropServices.ComVisible(false)>]
static member FromHandle : Microsoft.Win32.SafeHandles.SafeRegistryHandle * Microsoft.Win32.RegistryView -> Microsoft.Win32.RegistryKey
Public Shared Function FromHandle (handle As SafeRegistryHandle, view As RegistryView) As RegistryKey

参数

handle
SafeRegistryHandle

注册表项的句柄。

view
RegistryView

要使用的注册表视图。

返回

注册表项。

属性

例外

view 无效。

handlenull

用户没有必需的注册表权限。

用户没有执行此操作所需的权限。

注解

view此方法的参数用于后续操作,例如打开子项。

如果 viewRegistry64 ,但计算机运行的是 32 位操作系统,则返回的密钥将使用 Registry32 视图。

适用于