Getting the list of installed programs on the local machine
Here's a snippet from the win-tech-off-topic list:
Getting the list of installed programs on the local machine:
///
/// This Method will give you list of all programs installed in Add Remove Programs.
///
static void GetInstalled()
{
string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
RegistryKey abc = Registry.Users;
using (RegistryKey regKey = Registry.LocalMachine.OpenSubKey(uninstallKey))
{
foreach (string subKeyName in regKey.GetSubKeyNames())
{
using (RegistryKey sk = regKey.OpenSubKey(subKeyName))
{
if (sk.GetValue("DisplayName") != null && sk.GetValue("DisplayVersion")!=null)
{
Console.WriteLine(sk.GetValue("DisplayName").ToString().Trim() + "\t" + sk.GetValue("DisplayVersion").ToString().Trim());
}
}
}
}
}
No comments:
Post a Comment