954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Listing All The Installed Softwares In Computer Using .Net

0
By sandeepparekh9 on Jun 2nd, 2011 4:17 pm

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);
 
 
        }

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

vishalrane
Junior Poster in Training
93 posts since Jun 2011
Reputation Points: 10
Solved Threads: 13
 
sandeepparekh9
Posting Whiz
367 posts since Dec 2010
Reputation Points: 123
Solved Threads: 71
 

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

Creelers
Newbie Poster
3 posts since Apr 2011
Reputation Points: 10
Solved Threads: 0
 

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

vishalrane
Junior Poster in Training
93 posts since Jun 2011
Reputation Points: 10
Solved Threads: 13
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You