CSharp examples for Operating System:Cpu
Get CPU Serial No
// All Rights Reserved , Copyright (C) 2012 , Hairihan TECH, Ltd. using System.Net.NetworkInformation; using System.Net; using System.Management; using System.Collections.Generic; public class Main{ public static string GetCPUSerialNo() {/*from w w w.j a v a2 s . co m*/ string cpuSerialNo = string.Empty; ManagementClass managementClass = new ManagementClass("Win32_Processor"); ManagementObjectCollection managementObjectCollection = managementClass.GetInstances(); foreach (ManagementObject managementObject in managementObjectCollection) { cpuSerialNo = managementObject.Properties["ProcessorId"].Value.ToString(); break; } return cpuSerialNo; } }