コード例 #1
0
ファイル: Wmi.cs プロジェクト: CaptainTF/bukkitgui2
 public static List<string> GetRegistryInfo_List(RegistryProp type)
 {
     ManagementObjectSearcher managementObjectSearcher =
         new ManagementObjectSearcher("Select " + type + " From Win32_Registry");
     ManagementObjectCollection managementObjectCollection = managementObjectSearcher.Get();
     List<string> result = new List<string>();
     foreach (ManagementObject managementObject in managementObjectCollection.Cast<ManagementObject>())
     {
         result.Add(managementObject[type.ToString()].ToString());
     }
     return result;
 }
コード例 #2
0
ファイル: Wmi.cs プロジェクト: CaptainTF/bukkitgui2
 public static string GetRegistryInfo(RegistryProp type, string name)
 {
     ManagementObjectSearcher managementObjectSearcher =
         new ManagementObjectSearcher("Select " + type + " from Win32_Registry Where Name = '" + name + "'");
     ManagementObjectCollection managementObjectCollection = managementObjectSearcher.Get();
     string result = null;
     foreach (ManagementObject managementObject in managementObjectCollection.Cast<ManagementObject>())
     {
         result = managementObject[type.ToString()].ToString();
     }
     return result;
 }