https://docs.microsoft.com/en-us/dotnet/api/microsoft.win32.registryview?view=netframework-4.7

On the 64-bit version of Windows, portions of the registry are stored separately for 32-bit and 64-bit applications. There is a 32-bit view for 32-bit applications and a 64-bit view for 64-bit applications.

You can specify a registry view when you use the OpenBaseKey and OpenRemoteBaseKey(RegistryHive, String, RegistryView) methods, and the FromHandle property on a RegistryKey object.

If you request a 64-bit view on a 32-bit operating system, the returned keys will be in the 32-bit view.

https://stackoverflow.com/questions/13728491/opensubkey-returns-null-for-a-registry-key-that-i-can-see-in-regedit-exe

A 32-bit application on a 64-bit OS will be looking at the HKLM\Software\Wow6432Node node by default. To read the 64-bit version of the key, you'll need to specify the RegistryView:

using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
using (var key = hklm.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"))
{
// key now points to the 64-bit key
}

RegistryView的更多相关文章

  1. 检测计算机已经安装的NetFramework版本(摘录)

    /// /// 检测计算机已经安装的NetFramework版本 /// internal void GetVersionFromRegistry() { using (RegistryKey ndp ...

  2. 使用.NET 4.0+ 操作64位系统中的注册表

    一.64位系统中的注册表 以 LocalMachine 中的启动项为例: 64位应用的注册表位置还是在: SOFTWARE\Microsoft\Windows\CurrentVersion\Run 而 ...

  3. c#注册表对象映射

    用于快捷保存与读取注册表,为对应的对象 示例 [RegistryRoot(Name = "superAcxxxxx")] public class Abc : IRegistry ...

  4. c#_自动化测试 (五) 读写64位操作系统的注册表

    非Web程序(桌面程序)的设置一般都存在注册表中. 给这些程序做自动化测试时, 需要经常要跟注册表打交道. 通过修改注册表来修改程序的设置. 本章介绍如何利用C#程序如何操作注册表, 特别是如何操作6 ...

  5. RegistryKey 类

    表示 Windows 注册表中的项级节点. 此类是注册表封装. 继承层次结构 System.Object   System.MarshalByRefObject    Microsoft.Win32. ...

  6. 使用.netFx4.0提供的方法解决32位程序访问64位系统的64位注册表

    原文:使用.netFx4.0提供的方法解决32位程序访问64位系统的64位注册表 我们知道目标平台是32位的程序运行在64位的系统上,去访问部分注册表的时候系统自动重定向到win32node节点对应的 ...

  7. 64位系统访问注册表SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    public int ChecNonkWoW64() { try { ; string subKey = @"SOFTWARE\Microsoft\Windows\CurrentVersio ...

  8. C#中级-从零打造基于Socket在线升级模块

    一.前言       前段时间一直在折腾基于Socket的产品在线升级模块.之前我曾写过基于.Net Remoting的.基于WCF的在线升级功能,由于并发量较小及当时代码经验的不足一直没有实际应用. ...

  9. C# winform 检测当前电脑安装的.net framework版本

    private static bool GetDotNetRelease(int release) { const string subkey = @"SOFTWARE\Microsoft\ ...

随机推荐

  1. BZOJ 2973 入门OJ4798 石头游戏

    矩阵递推 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring ...

  2. 了不得,我可能发现了Jar 包冲突的秘密

    一.前言 这篇是类加载器相关的第三篇: 实战分析Tomcat的类加载器结构(使用Eclipse MAT验证) 还是Tomcat,关于类加载器的趣味实验 昨天下午刚写了篇 类加载器相关的,晚上想着验证个 ...

  3. Activity 切换动画

    1,在AndroidManifest.xml中的Activity的声明上加入android:theme="@style/Anim_fade" <activity androi ...

  4. 在Fedora 22下安装配置RealVNC Server 5.2.3的经验总结

    RealVNC是目前功能最全.性能最好的VNC商业软件套件,很多时候为了确保性能和功能的统一,还是大量地在使用RealVNC.最近在Fedora 22工作站上安装RealVNC Server 5.2. ...

  5. T1164 统计数字 codevs

    http://codevs.cn/problem/1164/ 题目描述 Description [问题描述]某次科研调查时得到了n个自然数,每个数均不超过1500000000(1.5*109).已知不 ...

  6. LeetCode:926. 将字符串翻转到单调递增

    暴力法超时:思想:动态规划 public int minFlipsMonoIncrb(String S) { int result = S.length(); for (int i = 0; i &l ...

  7. MD5加密算法Java代码

    原文:http://www.open-open.com/code/view/1428398234916 import java.security.MessageDigest; import java. ...

  8. Thrift --- 支持双向通信

    [问题] Thrift采用了C/S模型,不支持双向通信:client只能远程调用server端的RPC接口,但client端则没有RPC供server端调用,这意味着,client端能够主动与serv ...

  9. Swift标识符和keyword

    不论什么一种计算机语言都离不开标识符和keyword,下面我们将具体介绍Swift标识符和keyword. 标示符 标识符就是给变量.常量.方法.函数.枚举.结构体.类.协议等指定的名字.构成标识符的 ...

  10. MapReduce编程实战之“调试”和&quot;调优&quot;

    本篇内容 在上一篇的"初识"环节,我们已经在本地和Hadoop集群中,成功的执行了几个MapReduce程序,对MapReduce编程,已经有了最初的理解. 在本篇文章中,我们对M ...