Hardware ID [Visual Basic]

Tools
User avatar
alphamale
Posts: 15
Joined: Sun Aug 27, 2017 3:50 pm

Hardware ID [Visual Basic]

Postby alphamale » Wed Aug 22, 2018 3:19 pm

GET HWID

Code: Select all

Imports System.Management

Public Class Form1

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim *****uInfo As String = String.Empty
        Dim mc As New ManagementClass("win32_processor")
        Dim moc As ManagementObjectCollection = mc.GetInstances()

        For Each mo As ManagementObject In moc
            If *****uInfo = "" Then
                *****uInfo = mo.Properties("processorID").Value.ToString()
                Exit For
            End If
        Next

        TextBox1.Text = *****uInfo
    End Sub
End Class


USE HWID

Code: Select all

Imports System.Management

Public Class Form1
    Public hwid As String = "yourhwid"
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim *****uInfo As String = String.Empty
        Dim mc As New ManagementClass("win32_processor")
        Dim moc As ManagementObjectCollection = mc.GetInstances()

        For Each mo As ManagementObject In moc
            If *****uInfo = "" Then
                *****uInfo = mo.Properties("processorID").Value.ToString()
                Exit For
            End If
        Next

        If *****uInfo <> hwid Then
            MsgBox("Bad HWID verification, application will close")
            Application.Exit()
        End If
    End Sub
End Class

Return to “Tools”