Avoid Registry Wow6432Node Redirection

前端 未结 4 1406
-上瘾入骨i
-上瘾入骨i 2020-11-30 07:16

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         


        
4条回答
  •  执笔经年
    2020-11-30 08:06

    You can use RegistryKey.OpenBaseKey to solve this problem:

    var baseReg = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
    var reg = baseReg.CreateSubKey("Software\\Test");
    

提交回复
热议问题