通過WMI獲得硬碟和CPU的物理序列號

2021-04-25 22:42:17 字數 953 閱讀 9509

/'獲得硬碟序列號

dim cmicwmi as new system.management.managementobjectsearcher(/"select * from win32_diskdrive/")

dim uint32 as uint32

for each cmicwmiobj as managementobject in cmicwmi.get

uint32 = cmicwmiobj(/"signature/")

next

textbox1.text = uint32.tostring

/'獲得cpu序列號

dim wmi as new system.management.managementobjectsearcher(/"select * from win32_processor/")

dim uint32 as string

for each wmiobj as managementobject in wmi.get

uint32 = wmiobj(/"processorid/")

next

textbox1.text = uint32

/'獲得硬碟總容量

dim wmi as new system.management.managementobjectsearcher(/"select * from win32_diskdrive/")

dim uint64 as uint64

for each wmiobj as managementobject in wmi.get

uint64 = wmiobj(/"size/")

next

textbox1.text = uint64.tostring

首先,引用system.management;然後在**中imports system.management;

使用c 獲得cpu,硬碟的序列號

using system using system.runtime.interopservices using system.management namespace hardware 取cpu編號 public string getcpuid return strcpuid catch end m...

CPU和硬碟的效能相差多少!

本文以乙個現代的 實際的個人電腦為物件,分析其中cpu intel core 2 duo 3.0ghz 以及各類子系統的執行速度 延遲和資料吞吐量。通過粗略的估算pc各個元件的相對執行速度,希望能給大家留下乙個比較直觀的印象。本文中的資料來自實際應用,而非理論最大值。時間的單位是納秒 ns,十億分之...

C 獲取CPU和硬碟序列號的原始碼

c 獲取cpu和硬碟序列號的原始碼 首先需新增對system.management的引用。using system using system.runtime.interopservices using system.management namespace hardware 取cpu編號 publi...