Click here to Skip to main content
12,953,491 members (59,980 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i need help in order to get my cpu id in the programming language visual basic
what i really want to do is to get the cup id to be on a label

i try this code but i get a load of errors
here it is
Imports System.Management
Dim objMOS As ManagementObjectSearcher
        Dim objMOC As Management.ManagementObjectCollection
        Dim objMO As Management.ManagementObject
        objMOS = New ManagementObjectSearcher("Select * From Win32_Processor")
        objMOC = objMOS.Get
        For Each objMO In objMOC
            Label31.Text = ("CPU ID = " & objMO("ProcessorID"))
        objMOS = Nothing
        objMO = Nothing
Posted 4-Nov-12 15:04pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

And the errors would be .....???

CPUID returns information about the processor. It is not the unique serial number for your particular processor.

You might want to read up on what the ProcessorID field returns, here[^], and what is returned when EAX is set to 1 during the call to CPUID. That would be the Processor Info and Feature Bits, but all of them. The docs on that can be found here[^].

Oh, and you forgot this:
Label31.Text = "CPU ID = " & objMO("ProcessorID").Value

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,429
CHill60 3,490
Maciej Los 3,103
ppolymorphe 2,020
Jochen Arndt 1,975

Advertise | Privacy | Mobile
Web01 | 2.8.170525.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100