我有 ac# 应用程序,我正在尝试从中读取“WindowsUpdate”子键,
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update
它总是返回 null。
代码示例如下,
Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion");
{HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion}
base {System.MarshalByRefObject}: {HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion}
Handle: {Microsoft.Win32.SafeHandles.SafeRegistryHandle}
Name: "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion"
SubKeyCount: 52
ValueCount: 11
View: Default
Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate");
null
Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update");
null
Registry.LocalMachine.OpenSubKey("Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate");
null