避免注册Wow6432Node重定向 [英] Avoid Registry Wow6432Node Redirection
本文介绍了避免注册Wow6432Node重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想插入使用C#中Microsoft.Win32.RegistryKey一些简单的注册表项,但路径自动改变:
I'm trying to insert some simple registry keys using Microsoft.Win32.RegistryKey in c# but the path automatically changes from:
HKEY_LOCAL_MACHINE\SOFTWARE\Test
到
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Test
我试图谷歌,但我只得到一些模糊和混乱的结果。有没有人处理这个问题之前?一些示例代码将非常appereciated
I tried google but I only get some vague and confusing results. Has anyone dealt with this issue before? Some example code would be much appereciated.
推荐答案
您可以使用RegistryKey.OpenBaseKey来解决这个问题:
You can use RegistryKey.OpenBaseKey to solve this problem:
var baseReg = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
var reg = baseReg.CreateSubKey("Software\\Test");
这篇关于避免注册Wow6432Node重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文