简体   繁体   English

无法写入HKEY_CURRENT_USER

[英]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 x64Win 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.

相关问题 将注册表写入hkey_current_user而不是hkey_users - write registry to hkey_current_user instead of hkey_users 无法在C#中写入HKEY_CURRENT_USER注册表项 - Can't write to HKEY_CURRENT_USER registrykey in C# 在IIS下读取HKEY_CURRENT_USER - Reading HKEY_CURRENT_USER under IIS 比较HKEY_USER和HKEY_CURRENT_USER - Comparing the HKEY_USER and HKEY_CURRENT_USER 如何启用 ASP.NET 对注册表项“HKEY_CURRENT_USER\\Software\\myAppKey\\subdir”的写访问权限? - How to enable ASP.NET write access to the registry key 'HKEY_CURRENT_USER\Software\myAppKey\subdir'? 如何从 WinUI3 C# 应用程序写入 HKEY_CURRENT_USER\\Control Panel\\Desktop\\WindowMetrics - How to write to HKEY_CURRENT_USER\\Control Panel\\Desktop\\WindowMetrics from WinUI3 C# app HKEY_CURRENT_USER不会发生注册表重定向 - Registry redirection does not happen for HKEY_CURRENT_USER 模拟获取用户 HKEY_CURRENT_USER 不起作用? - Impersonation to get user HKEY_CURRENT_USER does not work? 从注册表读取HKEY_CURRENT_USER的子项将返回HKEY_USERS子项的值 - Reading subkeys of HKEY_CURRENT_USER from Registry returns HKEY_USERS subkeys value 有没有一种方法可以创建注册表子项并在HKEY_CURRENT_USER \\下设置它的值…\\ FEATURE_BROWSER_EMULATION \\ - Is there a way to create a registry SubKey and set it's value under HKEY_CURRENT_USER\ … \FEATURE_BROWSER_EMULATION\
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM