Try,
Microsoft.Win32 .RegistryKey subKey1 =
regKey.OpenSubK ey("SOFTWARE\\M icrosoft\\Windo ws\\CurrentVers ion\\Uninstall" );
string[] subKeyNames = subKey1.GetSubK eyNames();
foreach (string subKeyName in subKeyNames)
{
Microsoft.Win32 .RegistryKey subKey2 = subKey1.OpenSub Key(subKeyName) ;
if (ValueNameExist s(subKey2.GetVa lueNames(), "DisplayNam e") &&
ValueNameExists (subKey2.GetVal ueNames(), "DisplayVersion "))
{
listViewApps.It ems.Add(new ListViewItem(ne w string[]{
subKey2.GetValu e("DisplayName" ).ToString(),
subKey2.GetValu e("DisplayVersi on").ToString () }));
}
subKey2.Close() ;
}
subKey1.Close() ;
and...
private bool ValueNameExists (string[] valueNames, string valueName)
{
foreach (string s in valueNames)
{
if (s.ToLower() == valueName.ToLow er()) 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