-
-
public class GF_Hardware
-
{
-
-
-
-
-
public static string getID_CpuId()
-
{
-
string cpuInfo = "";
-
ManagementClass cimobject = new ManagementClass("Win32_Processor");
-
ManagementObjectCollection moc = cimobject.GetInstances();
-
foreach (ManagementObject mo in moc)
-
{
-
cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
-
}
-
return cpuInfo;
-
}
-
-
-
-
-
-
public static string getID_HardDiskId()
-
{
-
string HDid = "";
-
ManagementClass cimobject = new ManagementClass("Win32_DiskDrive");
-
ManagementObjectCollection moc = cimobject.GetInstances();
-
foreach (ManagementObject mo in moc)
-
{
-
HDid = (string)mo.Properties["Model"].Value;
-
}
-
return HDid;
-
}
-
-
-
-
-
-
public static string getID_NetCardId()
-
{
-
string NCid = "";
-
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
-
ManagementObjectCollection moc = mc.GetInstances();
-
foreach (ManagementObject mo in moc)
-
{
-
if ((bool)mo["IPEnabled"] == true)
-
NCid = mo["MacAddress"].ToString();
-
mo.Dispose();
-
}
-
return NCid;
-
}
-
-
-
-
}