Click here to Skip to main content
12,350,735 members (23,952 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
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"))
 
        Next
 
        objMOS.Dispose()
 
        objMOS = Nothing
 
        objMO.Dispose()
 
        objMO = Nothing
Posted 4-Nov-12 15:04pm
sean871526

1 solution

Rate this: bad
 
good
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
  Permalink  

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


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2016
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