我有一个C#应用程序,尝试从以下路径读取"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