سلام توی یکی از تایپیکا در مورد بدست آوردن آی پی سی پی یو نوشته بود که با یوزینگ
system.management کار می کرد ولی من همچین چیزی رو تو یوزینگام نمی بینم جریان چیه؟؟؟
Printable View
سلام توی یکی از تایپیکا در مورد بدست آوردن آی پی سی پی یو نوشته بود که با یوزینگ
system.management کار می کرد ولی من همچین چیزی رو تو یوزینگام نمی بینم جریان چیه؟؟؟
public string GetCPUId()
{
string cpuInfo = String.Empty;
//create an instance of the Managemnet class with the
//Win32_Processor class
ManagementClass mgmt = new ManagementClass("Win32_Processor");
//create a ManagementObjectCollection to loop through
ManagementObjectCollection objCol = mgmt.GetInstances();
//start our loop for all processors found
foreach (ManagementObject obj in objCol)
{
if (cpuInfo == String.Empty)
{
// only return cpuInfo from first CPU
cpuInfo = obj.Properties["ProcessorId"].Value.ToString();
}
}
return cpuInfo;
}
برو تو منوی Projects بعد Add Reference تو قسمت.NET اینو دوبار کلیک کن تا به رفرنسات اضافه بشه؟
System.Management