x86組合語言
有個cpuid的指令
可配合各大cpu廠商的相關spec進行對照
有cpu型號, cpu序號, cpu內的catch size...等
或是用 CPU-Z 這個軟體去看, 但看不到 cpu序號, 只能看型號
http://www.cpuid.com/softwares/cpu-z/versions-history.html
凡是硬體或比較低階的問題就往API想,你要取得CPU的序號方式可以呼叫kernel32中的GetSystemInfo,GetSystemInfo的參數請參照MSDN網頁說明
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/system_info_str.asp
寫法如下(按下Command1按鍵就可以取出CPU號碼),希望對你有幫助。
Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Private Type SYSTEM_INFO
dwOemID As Long
wProcessorArchitecture As Long
wReserved As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Integer
wProcessLevel As Integer
wProcessorRevision As Integer
End Type
Private Sub Command1_Click()
Dim CPUInfo As SYSTEM_INFO
GetSystemInfo CPUInfo
MsgBox "你的CPU是" & CPUInfo.wReserved
End Sub
可以參考下述網址:
http://www.vbgood.com/vbt.good/vbt.good/t7321.html
也是一個不錯的解決方式