新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Private Type SYSTEM_INFO
dwOemID As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
dwReserved As Long
End Type
Private Sub Command1_Click()
Dim InfoResult As SYSTEM_INFO
GetSystemInfo InfoResult
MsgBox "Your CPU type is " & InfoResult.dwProcessorType
MsgBox "You have " & InfoResult.dwNumberOrfProcessors & " processor(s)"
End Sub