What are some alternatives to RegistryKey.OpenBaseKey in .NET 3.5?

后端 未结 3 2018
迷失自我
迷失自我 2020-11-30 12:35

I\'ve been working on an installer package and using RegistryKey.OpenBaseKey to work with custom actions that either open and add/remove keys to/from the 64-bit registry or

3条回答
  •  不知归路
    2020-11-30 13:15

    For .NET versions earlier than version 4 there is no framework API that allows access to alternate registry views. In order to access alternate views you must call the native API RegOpenKeyEx passing one of the KEY_WOW64_32KEY or KEY_WOW64_64KEY flags as appropriate.

    Common ways to do this are with C++/CLI mixed mode assemblies, or using P/Invoke. However, this is not very much fun at all. The registry APIs are some of the more awkward to use, because they support multiple data types for values.

提交回复
热议问题