![](/img/trans.png)
[英]Windows Update API with C# not finding any installed updates
[英]List of Installed Updates on Windows 7 C#
借助Microsoft Ultimate Wisdom,他们已更改了注册表中更新的位置。 我可以从Windows 2003 Server获得更新,没有问题。 只是Windows 7不再存在:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
任何人都有其他途径来获得它。 最好使用C#或使用WMI?
上帝用他们的智慧拯救微软
对于Windows 7 64位,它位于HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Wow6432Node \\ Microsoft \\ Updates中
private string GetX64Installedsoftware()
{
string Software = null;
string SoftwareKey = @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall";
Software += "\r\nWINDOWS X64 Software\r\n\r\n\r\n ";
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(SoftwareKey))
{
if (rk == null)
{
return Software;
}
foreach (string skName in rk.GetSubKeyNames())
{
using (RegistryKey sk = rk.OpenSubKey(skName))
{
try
{
if (!(sk.GetValue("DisplayName") == null))
{
if (sk.GetValue("InstallLocation") == null)
Software += sk.GetValue("DisplayName") + " - Install path not known \r\n ";
else
Software += sk.GetValue("DisplayName") + " - " + sk.GetValue("InstallLocation") + "\r\n ";
}
}
catch (Exception ex)
{
}
}
}
}
return Software;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.