zoukankan      html  css  js  c++  java
  • 如何获取本机已经安装了的软件的列表?

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

            }

        }

    }
  • 相关阅读:
    C if语句判断年龄
    C 计算时间差
    C 计算身高
    JRebel激活破解完美解决方式
    Maven optional和scope
    判断当前时间是否在某个时间段内
    给定时间加上几个小时
    RabbitMQ学习笔记
    浏览器、服务器会话
    Maven核心知识点梳理
  • 原文地址:https://www.cnblogs.com/sskset/p/153109.html
Copyright © 2011-2022 走看看