Listing All The Installed Softwares In Computer Using .Net

Updated sandeepparekh9 0 Tallied Votes 183 Views Share

Listing All The Installed Softwares In Computer Using .Net

Don't Forget To add using Microsoft.Win32

For Complete thread with screen shots see here:[snipped]

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);
 
 
        }
vishalrane 0 Junior Poster in Training

how to use dis code in asp.net using C#...

sandeepparekh9 109 Posting Whiz
Creelers 0 Newbie Poster

I get an "Object reference not set to an instance of an object" error when I start the program.

vishalrane 0 Junior Poster in Training

Are u talking about asp.net or vb.net...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.