已安装应用程序列表的代码提供错误结果 [英] Code for List of installed Applications is Giving Wrong Result

查看:84
本文介绍了已安装应用程序列表的代码提供错误结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我使用下面的代码获取Windows中已安装程序的列表。

此代码完美运行在我的32位Windows 7机器上,但是在我的Windows 8 64位机器上,它获得了一个应用程序列表但不完整或不正确。



Hi,

I am using the code below to get the list of installed programs in windows.
This code is working perfectly in my 32 Bit Windows 7 machine, but on my Windows 8 64 bit machine, it is getting a list of applications but not incomplete or incorrect.

RegistryKey baseRegistryKey = Registry.LocalMachine;
string subKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
RegistryKey uninstallKey = baseRegistryKey.OpenSubKey(subKey);
string[] allApplications = uninstallKey.GetSubKeyNames();





有人可以帮我弄清楚机器可能出了什么问题吗?



Can somebody help me figure out what might be wrong with the machine?

推荐答案

这里有一个类似的问题:如何从Windows 64位中的注册表中检索应用程序列表 [ ^ ]

它明显分享:

这是因为注册表重定向 [ ^ ]。



具体来说,有一个包含注册表项的Wow6432Node s用于64位操作系统上的32位进程( WOW64 [ ^ ])。



见这个MSDN [ ^ ]文章了解更多信息。

另见所以 [ ^ ] thread。




另一个Microsoft支持网站用类似的方式讨论如何存储密钥:如何使用64位版本的Win查看系统注册表dows [ ^ ]
A similar question here: How to retrieve list of applications from registry in Windows 64 bit[^]
It clearly shares:
This is because of registry redirection[^].

Specifically, there is a Wow6432Node that contains registry keys for 32-bit processes on a 64-bit OS (WOW64[^]).

See this MSDN[^] article for more information.
See also this SO[^] thread.


Another Microsoft support site talking on similar lines explaining on how keys are stored: How to view the system registry by using 64-bit versions of Windows[^]

这篇关于已安装应用程序列表的代码提供错误结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆