VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - VB5中确定CPU类型
发表评论(0)作者:, 平台:, 阅读:11615, 日期:2000-03-17
VB5中确定CPU类型


我们可以使用API函数 GetSystemInfo 来确定CPU的类型。代码如下:


Option Explicit

Private Type SYSTEM_INFO

dwOemID As Long

dwPageSize As Long

lpMinimumApplicationAddress As Long

lpMaximumApplicationAddress As Long

dwActiveProcessorMask As Long

dwNumberOfProcessors As Long

dwProcessorType As Long

dwAllocationGranularity As Long

dwReserved As Long

End Type

Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)



Private Sub Form_Activate()

Dim Sys As SYSTEM_INFO

GetSystemInfo Sys

Print "处理器类型:"; Sys.dwProcessorType

Print "处理器序号:"; Sys.dwNumberOfProcessors

End Sub