列举所有可以被卸载的软件 const string registryKey = @"SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall"; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { using (RegistryKey key = Registry.LocalMachine.OpenSubKey(registryKey)) { foreach (string keyName in key.GetSubKeyNames()) { // open the registry key for this application RegistryKey ApplicationKey = key.OpenSubKey(keyName); // skip if no display name if (ApplicationKey.GetValue("DisplayName") == null) continue; // get the application name string ApplicationName = ApplicationKey.GetValue("DisplayName").ToString(); // output the result listBox1.Items.Add(ApplicationName); } } }