• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 224  文章 - 41  trackbacks - 0
            <2010年8月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            享受編程

            常用鏈接

            留言簿(11)

            隨筆分類(159)

            隨筆檔案(224)

            文章分類(2)

            文章檔案(4)

            經典c++博客

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            原文地址:http://hi.baidu.com/guigangsky/blog/item/da375f319a3f6a1ceac4af01.html/cmtid/c6ef9651d58acb15377abef1

            //Registry.ClassesRoot   對應注冊表 HKEY_CLASSES_ROOT
            //Registry.CurrentConfig 對應注冊表 HKEY_CURRENT_CONFIG
            //Registry.CurrentUser   對應注冊表 HKEY_CURRENT_USER
            //Registry.LocalMachine   對應注冊表 HKEY_LOCAL_MACHINE
            //Registry.Users   對應注冊表 HKEY_USERS

            using System;
            using Microsoft.Win32;
            using System.Windows.Forms;

            namespace WindowsFormsApplication1
            {
                public partial class Form1 : Form
                {
                    public Form1()
                    {
                        InitializeComponent();
                    }

                    private void button1_Click(object sender, EventArgs e)
                    {
                        string temp = null, tempType = null;
                        object displayName = null, uninstallString = null, releaseType = null;
                        RegistryKey currentKey = null;
                        int softNum = 0;
                        RegistryKey pregkey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall");//獲取指定路徑下的鍵
                        try
                        {
                            foreach (string item in pregkey.GetSubKeyNames())               //循環所有子鍵
                            {
                                currentKey = pregkey.OpenSubKey(item);
                                displayName = currentKey.GetValue("DisplayName");           //獲取顯示名稱
                                uninstallString = currentKey.GetValue("UninstallString");   //獲取卸載字符串路徑
                                releaseType = currentKey.GetValue("ReleaseType");           //發行類型,值是Security Update為安全更新,Update為更新
                                bool isSecurityUpdate=false;
                                if (releaseType != null)
                                {
                                    tempType = releaseType.ToString();
                                    if (tempType == "Security Update" || tempType == "Update")
                                        isSecurityUpdate = true;
                                }
                                if (!isSecurityUpdate && displayName != null && uninstallString != null)
                                {
                                    softNum++;
                                    temp += displayName.ToString() + Environment.NewLine;
                                }
                            }
                        }
                        catch (Exception E)
                        {
                            MessageBox.Show(E.Message.ToString());
                        }
                        tbSoftWare.Text = "共有軟件" + softNum.ToString() + "個"+ Environment.NewLine + temp;
                        pregkey.Close();
                    }

                }
            }

            posted on 2010-06-12 17:37 漂漂 閱讀(4207) 評論(0)  編輯 收藏 引用 所屬分類: c#開發
            亚洲精品午夜国产VA久久成人 | 久久婷婷久久一区二区三区| 亚洲国产精品无码久久久不卡 | 久久精品不卡| 久久性生大片免费观看性| 亚洲精品99久久久久中文字幕| 97久久国产综合精品女不卡| 久久香蕉国产线看观看99| 亚洲&#228;v永久无码精品天堂久久 | 久久夜色精品国产噜噜麻豆| 久久青青草原综合伊人| 性做久久久久久久久老女人| 久久香蕉国产线看观看99| 国产A三级久久精品| 久久久中文字幕日本| 久久精品国产亚洲沈樵| 精品久久久无码21p发布| 精品久久人人做人人爽综合 | 国产美女亚洲精品久久久综合| 伊人久久大香线焦综合四虎| 热re99久久精品国99热| 亚洲精品NV久久久久久久久久| 狠狠人妻久久久久久综合| 国产精品欧美久久久天天影视| 国产色综合久久无码有码| 亚洲人成电影网站久久| 91久久精品视频| 99久久中文字幕| 国产91色综合久久免费分享| 亚洲狠狠婷婷综合久久久久| 伊人伊成久久人综合网777| 亚洲国产香蕉人人爽成AV片久久 | 国产精品九九久久免费视频 | 亚洲精品tv久久久久久久久| 四虎国产精品成人免费久久| 久久久久99精品成人片| 久久久久亚洲精品男人的天堂| 国产农村妇女毛片精品久久| 99热成人精品免费久久| 久久精品一区二区影院| 三级韩国一区久久二区综合 |