[英]Unable to write to HKEY_CURRENT_USER
I have a C#
program (VS2010) that writes values into a couple of HKEY_CURRENT_USER
Registry keys that we create. 我有一个
C#
程序(VS2010),它将值写入我们创建的几个HKEY_CURRENT_USER
注册表项中。 Normally this works fine, on Win XP, Vista, and 7, x86 and x64
. 通常,在
Win XP, Vista, and 7, x86 and x64
上Win XP, Vista, and 7, x86 and x64
这可以正常工作。 But on some machines, the keys just do not get written. 但是在某些机器上,密钥只是不被写入。 No exception thrown, the keys and values just aren't there afterwards.
没有引发异常,键和值之后就不存在了。
We're pulling out our hair trying to figure out why this would be happening. 我们正在拔头发,试图弄清楚为什么会这样。 It's really sporadic ... on one machine it does not work -- but does work on all the other machines in the same office or domain.
它确实是零星的,在一台计算机上不起作用-但在同一办公室或域中的所有其他计算机上都可以工作。
What should we be looking for? 我们应该寻找什么?
What you're describing sounds an awful lot like Microsoft's Registry Virtualization . 您所描述的内容听起来很像Microsoft的Registry Virtualization 。
But, as I understand, that only applies to HKEY_LOCAL_MACHINE\\Software for 32-bit applications. 但是,据我了解,这仅适用于HKEY_LOCAL_MACHINE \\ Software(用于32位应用程序)。
Registry Virtualization was introduced in Windows Vista as a way of providing backward-compatibility with applications that weren't written with Vista's UAC in mind. Windows Vista中引入了注册表虚拟化,以提供与未考虑Vista的UAC编写的应用程序的向后兼容性。 The idea is that it redirects your registry operations that would normally affect sensitive areas of the registry (like HKLM) to special locations, where the only impact would be to the current user.
这样做的目的是将通常会影响注册表的敏感区域(例如HKLM)的注册表操作重定向到特殊位置,其中唯一的影响将是当前用户。 It's supposed to also work backward - when accessing one of those parts of the registry, it'll check the redirected location before failing for a non-existent key.
它也应该向后工作-当访问注册表的那些部分之一时,它将在失败的密钥不存在之前检查重定向的位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.