添加命名空间:using Microsoft.Win32;定义:RegistryKey MyReg=Registry.LocalMachine.OpenSubKey("HARDWARE\\DESCRIPTION\\SYSTEM\\CentralProcessor\\0");获取CPU ID:MyReg.GetValue("Identifier").ToString();