码迷,mamicode.com
首页 > Windows程序 > 详细

64位系统访问注册表SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

时间:2016-08-17 19:35:46      阅读:994      评论:0      收藏:0      [点我收藏+]

标签:

 1  public int ChecNonkWoW64()
 2         {
 3 
 4             try
 5             {
 6                 int x64 = 0;
 7                 string subKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
 8                 string[] subkeyNames;
 9                 RegistryKey software = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
10                 software = software.OpenSubKey(subKey);
11                 subkeyNames = software.GetSubKeyNames();
12                 MessageBox.Show(subKey.ToString());
13 
14                 //取得该项下所有子项的名称的序列,并传递给预定的数组中  
15                 foreach (string keyName in subkeyNames)
16                 //遍历整个数组  
17                 {
18                     if (keyName.ToUpper().Contains("FF1CE"))
19                     //判断子项的名称  
20                     {
21                         bool ok = Isx64Code(keyName);
22                         if (ok)
23                         {
24                             x64 = 1;
25                         }
26                         else
27                         {
28                             x64 = -1;
29                         }
30                         software.Close();
31                         break;
32                     }
33                 }
34                 MessageBox.Show(x64.ToString());
35                 return x64;
36             }
37             catch (Exception)
38             {
39 
40                 throw;
41             }
42         }

 

64位系统访问注册表SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

标签:

原文地址:http://www.cnblogs.com/wuhailong/p/5781155.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!