遍历注册表搜索已安装软件(二层遍历) 2009年1月20日 上午10:20 • 软件开发 遍历注册表搜索已安装软件(二层遍历) private void button24_Click(object sender, EventArgs e) //显示已安装软件按钮 { listView4.Items.Clear(); //显示前清空 Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@”SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall”); //定义注册表操作类并指向注册表的软件信息目录 foreach (string site in rk.GetSubKeyNames()) //在Uninstall目录下搜索子键 { //listView4.Items.Add(site); RegistryKey subkey = rk.OpenSubKey(site); //定义注册表搜索子类 foreach (string m in subkey.GetValueNames()) //遍历搜索 { if (m == “DisplayName”) //搜索键名为DisplayName的键 { string name = subkey.GetValue(m).ToString(); //把键名为DisplayName的键值赋值给字符串 listView4.Items.Add(name); //Form显示 } //if (m == “DisplayVersion”) //{ // string ver = subkey.GetValue(m).ToString(); // //listView4.Items.Add(ver); // listView4.Items[0].SubItems.Add(ver); //} //if (m == “InstallLocation”) //{ // string locate = subkey.GetValue(m).ToString(); // //listView4.Items.Add(locate); // listView4.Items[0].SubItems.Add(locate); //} //listView4.Items.Add(name, ver, locate); } } label19.Text = “计算机内已安装的软件数量为:” + listView4.Items.Count.ToString(); } 声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢! 软件 生成海 金融危机加快布局 中国软件业目标锁定亚洲老大 上一篇 2009年1月19日 软件作坊怎么办?武汉项目经理沙龙 下一篇 2009年1月20日 相关推荐 产品读书《科技想要什么》KK 2019年1月1日 推荐一款国产远程控制软件ToDesk,轻量级,不限速,开启云办公新模式 2022年4月13日 SecureCrt 安装 2017年5月6日 系统架构师(二)案例题 2021年11月27日 LTC时间码解码器SMPTE时间码视频音频灯光同步曼彻斯特解码器 2020年7月2日 关键词排名软件-免费的自动关键词排名软件 2022年4月16日 CopyCat 代码克隆检测发布,剑指开源软件抄袭 2018年9月22日 source insight使用5—Source Insight4 界面总在最前的解决方法 2020年2月21日 手机软件:LG电子推出手机软件商店 年底前向欧美扩张 2009年7月22日 测试人生 | 从外包菜鸟到测试开发,薪资一年翻三倍,连自己都不敢信! 2022年8月16日