DEV Community

vblover programmer
vblover programmer

Posted on

VB .Net: Get Processor ID

Hi there....

For make software Activation-code we need A unique ID Like CPU(Processor)-ID

Reference:

System.Management
Enter fullscreen mode Exit fullscreen mode

Namespaces:

Imports System.Management
Imports Microsoft.Win32
Enter fullscreen mode Exit fullscreen mode

GetProcessInfo() Method:

Private Sub GetProcInfo()
        Dim wmi As ManagementClass
        Dim Mobjs As ManagementObjectCollection
        Dim CPUID As String
        Dim CPUType As String
        wmi = New ManagementClass("Win32_Processor")
        Mobjs = wmi.GetInstances()
        For Each Mobj As ManagementObject In Mobjs
            CPUType = Mobj("Name")
            Debug.WriteLine(CPUType.ToString)
            CPUID = Mobj("ProcessorID")
            Debug.WriteLine(CPUID.ToString)
        Next
        Mobjs.Dispose()
        wmi.Dispose()
    End Sub
Enter fullscreen mode Exit fullscreen mode

http://vbcity.com/forums/t/83343.aspx

Top comments (0)