如何获取本机已经安装了的软件的列表?

using System;
using Microsoft.Win32;

namespace ConsoleApplication7
{
    
/// <summary>
    
/// Class1 の概要の説明です。
    
/// </summary>

    class Class1
    
{
        
/// <summary>
        
/// アプリケーションのメイン エントリ ポイントです。
        
/// </summary>

        [STAThread]
        
static void Main(string[] args)
        
{
            RegistryKey rk 
= Registry.LocalMachine.OpenSubKey("SOFTWARE");

            PrintKeys(rk);

            Console.ReadLine();
        }


        
static void PrintKeys(RegistryKey rkey) 
        
{
            
// Retrieve all the subkeys for the specified key.
            String [] names = rkey.GetSubKeyNames();

            
// Print the contents of the array to the console.
            foreach (String s in names) 
            
{
                Console.WriteLine(s);
            }

        }

    }

}
原文地址:https://www.cnblogs.com/sskset/p/153109.html