First we must include the following namespace.
using Microsoft.Win32;
Then to retrieve all installed applications, add the following code on your main function.
static void Main(string[] args)
{
string regkey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(regkey))
{
var query = from a in
key.GetSubKeyNames()
let r = key.OpenSubKey(a)
select new
{
Application = r.GetValue("DisplayName")
};
foreach (var item in query)
{
if (item.Application != null)
Console.WriteLine(item.Application);
}
}
}
For more LINQ coding tips & tricks, subscribe now.











