private void Form1_Load(object sender, EventArgs e)
{
string SoftwareKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products";
RegistryKey rk = default(RegistryKey);
rk = Registry.LocalMachine.OpenSubKey(SoftwareKey);
//string skname = null;
string sname = string.Empty;
ListView ListView1 = new ListView();
this.Controls.Add(ListView1);
ListView1.Dock = DockStyle.Fill;
ListView1.View = View.Details;
ListView1.Columns.Add("Installed Software");
foreach (string skname in rk.GetSubKeyNames())
{
try
{
sname = Registry.LocalMachine.OpenSubKey(SoftwareKey).OpenSubKey(skname).OpenSubKey("InstallProperties").GetValue("DisplayName").ToString();
ListView1.Items.Add(sname);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
}
Are you able to help answer this sponsored question?
Questions asked by members who have earned a lot of community kudos are featured in order to give back and encourage quality replies.