• <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
            <2008年11月>
            2627282930311
            2345678
            9101112131415
            16171819202122
            23242526272829
            30123456

            享受編程

            常用鏈接

            留言簿(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 漂漂 閱讀(4190) 評論(0)  編輯 收藏 引用 所屬分類: c#開發
            日本亚洲色大成网站WWW久久| 亚洲人成无码久久电影网站| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 香蕉久久av一区二区三区| 久久亚洲中文字幕精品有坂深雪| 精品久久久久久国产| 亚洲а∨天堂久久精品9966| 色诱久久av| 国产精品久久毛片完整版| 亚洲va久久久噜噜噜久久男同 | 国内精品久久久久久久97牛牛 | 久久免费99精品国产自在现线| 精品熟女少妇av免费久久| 区久久AAA片69亚洲| 久久精品国产半推半就| 美女久久久久久| 国产精品久久久久久搜索| 亚洲欧美一级久久精品| 亚洲国产精品婷婷久久| 久久久久亚洲精品无码蜜桃| 亚洲va久久久噜噜噜久久 | 91精品国产91久久| 亚洲午夜久久久久妓女影院| 久久国产劲爆AV内射—百度| 亚洲午夜久久久影院| 婷婷久久精品国产| 国产亚州精品女人久久久久久| 狠狠久久综合| 久久精品中文字幕久久| 久久精品中文字幕第23页| 思思久久好好热精品国产| 久久成人国产精品免费软件| 久久久久亚洲精品无码网址| 岛国搬运www久久| 久久伊人精品一区二区三区| 亚洲а∨天堂久久精品| 亚洲伊人久久综合影院| 看全色黄大色大片免费久久久| 久久99精品久久久久久噜噜| 日本免费久久久久久久网站| 久久国产精品免费一区|