Get the ID code of the CPU

zhaozj2021-02-16  100

Public Static String getcpuid ()

{

String cpuinfo = string.empty;

String temp = string.empty;

ManagementClass MC = New ManagementClass ("Win32_Processor");

ManagementObjectCollection moc = mc.getinstances ();

Foreach (ManagementObject Mo in MoC)

{

IF (cpuinfo == string.empty)

{

CPUINFO = mo.properties ["processorid"]. value.tostring ();

}

}

Return CPUInfo;

}

转载请注明原文地址:https://www.9cbs.com/read-11184.html

New Post(0)