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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay