来个示例看看

Private Sub Form_Load()
    Dim objWMIService
    Dim colItems
    Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor")
    For Each objItem In colItems
        Debug.Print "CPU ID: " & objItem.ProcessorId
    Next
End Sub

Views: 19

Hi, I’m 邓伟

本来无一物,何处惹尘埃

发表回复