API函数 GetSystemInfo 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
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