读取注册表并Wow6432Node关键 [英] Reading the registry and Wow6432Node key
问题描述
我有一些code读取注册表并会在HKEY_LOCAL_MACHINE \ SOFTWARE \ APP \值,但在Windows的64位版本上运行时,该值在HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \应用程序。
I have some code that reads the registry and looks for a value in HKEY_LOCAL_MACHINE\Software\App\ but when running on 64bit versions of Windows the value is under HKEY_LOCAL_MACHINE\Software\Wow6432Node\App.
我应该如何最好的办法呢?我需要一个64位安装程序或者我应该重写我的code检测这两个地方?
How should I best approach this? Do I need a 64bit installer or should I rewrite my code to detect both places?
推荐答案
如果你标记你的C#程序为86(而不是任何CPU),那么它会看到HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \应用程序为HKEY_LOCAL_MACHINE \ SOFTWARE \应用程序。
If you mark you C# program as x86 (and not Any CPU) then it will see HKEY_LOCAL_MACHINE\Software\Wow6432Node\App as HKEY_LOCAL_MACHINE\Software\App.
如果已安装64位.NET为任何CPU的.NET程序将作为64位进程中运行。 32位注册表是Wow6432Node为64位程序下。
A .NET program for Any CPU will run as a 64 bit process if 64 bit .NET is installed. The 32 bit registry is under the Wow6432Node for 64 bit programs.
这篇关于读取注册表并Wow6432Node关键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!