VB .Net: Get Processor ID

vblover programmer - Aug 30 - - Dev Community

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

. . . . . . .