using system;
using system.runtime.interopservices;
using system.management;
namespace hardware
//取cpu編號
public string getcpuid()
return strcpuid;
}catch
}//end method
//取第一塊硬碟編號
public string getharddiskid()
return strharddiskid ;
}catch
}//end
public enum ncbconst
[structlayout(layoutkind.sequential)]
public struct adapter_status
[structlayout(layoutkind.sequential)]
public struct name_buffer
[structlayout(layoutkind.sequential)]
public struct ncb
[structlayout(layoutkind.sequential)]
public struct lana_enum
[structlayout(layoutkind.auto)]
public struct astat
public class win32api
public string getmacaddress()
", adapter.adapt.adapter_address[0],
adapter.adapt.adapter_address[1],
adapter.adapt.adapter_address[2],
adapter.adapt.adapter_address[3],
adapter.adapt.adapter_address[4],
adapter.adapt.adapter_address[5]);
} }
}catch
{}return addr.replace(' ', '0'); } }
}
通過WMI獲得硬碟和CPU的物理序列號
獲得硬碟序列號 dim cmicwmi as new system.management.managementobjectsearcher select from win32 diskdrive dim uint32 as uint32 for each cmicwmiobj as manageme...
獲取CPU序列號,硬碟序列號,網絡卡mac位址
獲取cpu序列號,硬碟序列號,網絡卡mac位址 private string getmoc 獲取硬碟序列號 managementclass mchd new managementclass win32 logicaldisk managementobjectcollection mochd mchd...
C 獲取CPU序列號 網絡卡MAC位址 硬碟序列號
c 獲取cpu序列號 windows 管理規範 wmi 是可伸縮的系統管理結構,它採用乙個統一的 基於標準的 可擴充套件的物件導向介面。wmi 為您提供與系統管理資訊和基礎 wmi api 互動的標準方法。wmi 主要由系統管理應用程式開發人員和管理員用來訪問和作業系統管理資訊。wmi 可用於生成組...