64位系统访问注册表SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
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 }