Try,
Microsoft.Win32.RegistryKey subKey1 =
regKey.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\C urrentVersion\\Uninstall");
string[] subKeyNames = subKey1.GetSubKeyNames();
foreach (string subKeyName in subKeyNames)
{
Microsoft.Win32.RegistryKey subKey2 = subKey1.OpenSubKey(subKeyName);
if (ValueNameExists(subKey2.GetValueNames(), "DisplayName") &&
ValueNameExists(subKey2.GetValueNames(), "DisplayVersion"))
{
listViewApps.Items.Add(new ListViewItem(new string[]{
subKey2.GetValue("DisplayName").ToString(),
subKey2.GetValue("DisplayVersion").ToString() }));
}
subKey2.Close();
}
subKey1.Close();
and...
private bool ValueNameExists(string[] valueNames, string valueName)
{
foreach (string s in valueNames)
{
if (s.ToLower() == valueName.ToLower()) return true;
}
return false;
}
Regards,
Phil.
"Paul Horn" wrote:
Hi
I need some help here. I would appreciate it if any one can help me. My
2 questions is this:
1. How do you get a list of installed applications on Windows?
2. How do I get a program's description from a exe?
(Example - sqlservr.exe = Microsoft SQL Server 2000)
I am using C# with Visual Studio .net 2003. Thanks in advance...
Paul Horn
Pretoria
South Africa