Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO) Type SYSTEM_INFO dwOemID As Long dwPageSize As Long lpMinimumApplicationAddress As Long lpMaximumApplicationAddress As Long dwActiveProcessorMask As Long dwNumberOrfProcessors As Long 'Cpu的序号 dwProcessorType As Long 'Cpu的类型 dwAllocationGranularity As Long dwReserved As Long End Type '取得CPU的序列号 Function getCpuSN(sRoot As String) As Long Dim SInfo As SYSTEM_INFO 'Get the system information GetSystemInfo SInfo 'Print it to the form ' Me.Print "Number of procesor:" + Str$(SInfo.dwNumberOrfProcessors) ' Me.Print "Processor:" + Str$(SInfo.dwProcessorType) ' Me.Print "Low memory address:" + Str$(SInfo.lpMinimumApplicationAddress) ' Me.Print "High memory address:" + Str$(SInfo.lpMaximumApplicationAddress) getCpuSN = SInfo.dwOemID End Function
http://www.csdn.net/Develop/read_article.asp?id=23995一个利用DLL实现获得CPU信息的代码,十分专业,不但可以获得CPU的速度、型号等,而且可以获得CPU的缓存大小、流水线数等等30多项CPU的特性,而且,带了DLL的VC源程序。推荐下载:
http://www.applevb.com/sourcecode/GetCPU.zip
Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Type SYSTEM_INFO
dwOemID As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long 'Cpu的序号
dwProcessorType As Long 'Cpu的类型
dwAllocationGranularity As Long
dwReserved As Long
End Type '取得CPU的序列号
Function getCpuSN(sRoot As String) As Long
Dim SInfo As SYSTEM_INFO
'Get the system information
GetSystemInfo SInfo
'Print it to the form
' Me.Print "Number of procesor:" + Str$(SInfo.dwNumberOrfProcessors)
' Me.Print "Processor:" + Str$(SInfo.dwProcessorType)
' Me.Print "Low memory address:" + Str$(SInfo.lpMinimumApplicationAddress)
' Me.Print "High memory address:" + Str$(SInfo.lpMaximumApplicationAddress)
getCpuSN = SInfo.dwOemID
End Function
取CPUID.CSDN里就有一篇文章.
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=183644
---------------------------------
如何作?