using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
namespace SystemInfo
{
public class Hardware
{
public static class CPU
{
public const string RegPath = @"HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor";
public static string Get(string Key)
{
return (string)Registry.GetValue(RegPath + "\\0", Key, "");
}
public static string Name
{
get
{
return (string)Registry.GetValue(RegPath + "\\0", "ProcessorNameString", "");
}
}
public static string Identifier
{
get
{
return (string)Registry.GetValue(RegPath + "\\0", "Identifier", "");
}
}
}
public static class BIOS
{
public const string RegPath = @"HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS";
public static string Get(string Key)
{
return (string)Registry.GetValue(RegPath, Key, "");
}
public static Dictionary<string, string> Settings()
{
Dictionary<string, string> dictionary = new Dictionary<string, string>();
using (var SubKey = Registry.LocalMachine.OpenSubKey(RegPath.Split(new char[] { '\\' }, 2)[1]))
{
foreach (string Name in SubKey.GetValueNames())
{
dictionary.Add(Name, SubKey.GetValue(Name, "").ToString());
}
}
return dictionary;
}
}
}
}