Recuperación del sistema operativo info:
var wmi =
new ManagementObjectSearcher("select * from Win32_OperatingSystem")
.Get()
.Cast<ManagementObject>()
.First();
OS.Name = ((string)wmi["Caption"]).Trim();
OS.Version = (string)wmi["Version"];
OS.MaxProcessCount = (uint)wmi["MaxNumberOfProcesses"];
OS.MaxProcessRAM = (ulong)wmi["MaxProcessMemorySize"];
OS.Architecture = (string)wmi["OSArchitecture"];
OS.SerialNumber = (string)wmi["SerialNumber"];
OS.Build = ((string)wmi["BuildNumber"]).ToUint();
Recuperación de Información de la CPU:
var cpu =
new ManagementObjectSearcher("select * from Win32_Processor")
.Get()
.Cast<ManagementObject>()
.First();
CPU.ID = (string)cpu["ProcessorId"];
CPU.Socket = (string)cpu["SocketDesignation"];
CPU.Name = (string)cpu["Name"];
CPU.Description = (string)cpu["Caption"];
CPU.AddressWidth = (ushort)cpu["AddressWidth"];
CPU.DataWidth = (ushort)cpu["DataWidth"];
CPU.Architecture = (CPU.CpuArchitecture)(ushort)cpu["Architecture"];
CPU.SpeedMHz = (uint)cpu["MaxClockSpeed"];
CPU.BusSpeedMHz = (uint)cpu["ExtClock"];
CPU.L2Cache = (uint)cpu["L2CacheSize"] * (ulong)1024;
CPU.L3Cache = (uint)cpu["L3CacheSize"] * (ulong)1024;
CPU.Cores = (uint)cpu["NumberOfCores"];
CPU.Threads = (uint)cpu["NumberOfLogicalProcessors"];
CPU.Name =
CPU.Name
.Replace("(TM)", "™")
.Replace("(tm)", "™")
.Replace("(R)", "®")
.Replace("(r)", "®")
.Replace("(C)", "©")
.Replace("(c)", "©")
.Replace(" ", " ")
.Replace(" ", " ");
Lista de números de versión y la versión de Windows que corresponden a se puede encontrar [aquí] (https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832 (v = vs.85) .aspx). Windows 7: 6.1, Windows 8: 6.2, Windows 8.1: 6.3, Windows 10: 10.0 – Adam