hi and hello i have developed a desktop application and deployed it and it's working fine but what i simply want that my application should be installed in only one particular PC to whom i have sold it out but same setup should not install in other PC. becuase i have concern that my application can be sold out to some other via my clients so what should i do how to get hardware id so that it can be installed only in particular system thx to all

Dani AI

Generated

Short primer tied to this thread: wants an installer that runs only on a single sold machine; 's WMI-based enumeration is a useful starting point but it’s not a complete solution.

Key pitfalls to be aware of: many WMI fields are optional or vendor-dependent and can be empty, duplicated, or change when the owner upgrades hardware or restores a disk image. WMI access can fail without proper permissions and values can differ on VMs. Relying on a single property causes false lockouts; relying only on client-side checks is trivial for a determined attacker.

A practical, resilient pattern:

  • Build a fingerprint from several relatively stable identifiers (for example SMBIOS/UUID and an OS installation identifier), canonicalize and hash them to produce the machine ID.
  • Use an online activation service: send the hashed ID and purchase info, have the server issue a signed license token (RSA). The client validates the token locally with the public key and stores it encrypted.
  • Allow controlled reactivations and an offline activation fallback (signed challenge/response) so legitimate upgrades or hardware repairs don’t brick customers.
  • Protect local state with platform data-protection (not plain files) and keep sensitive logic server-side when possible.

Implementation notes and cautions: query WMI safely (check for nulls and catch exceptions), test on physical hardware and virtual machines, provide a support/transfer workflow, and accept that software-only protection raises the bar but cannot be perfectly tamper-proof. For API reference and patterns, see .NET WMI access (ManagementObjectSearcher) and a stable SMBIOS UUID source (Win32_ComputerSystemProduct). Use .NET cryptography for token signing/verification (RSA) and protect local tokens with DPAPI (ProtectedData).

see if this helps :

imports :

Imports System
Imports System.Management
Imports System.Management.Instrumentation
Imports System.IO
Imports System.Collections

Procedure to get info :

Private Sub getMotherBoardDetails()
        Try
            Dim objMOS As New ManagementObjectSearcher("SELECT * FROM  Win32_BaseBoard")
            Dim objMan As ManagementObject
            For Each objMan In objMOS.Get
                txtCaption.Text = objMan.GetPropertyValue("Caption").ToString()
                txtCreationClass.Text = objMan.GetPropertyValue("CreationClassName").ToString()
                txtDescription.Text = objMan.GetPropertyValue("Description").ToString()
                txtInstallDate.Text = Convert.ToDateTime(objMan.GetPropertyValue("InstallDate"))
                txtManufacturer.Text = objMan.GetPropertyValue("Manufacturer").ToString()
                txtModel.Text = Convert.ToString(objMan.GetPropertyValue("Model"))
                txtName.Text = objMan.GetPropertyValue("Name").ToString()
                txtPartNumber.Text = Convert.ToInt32(objMan.GetPropertyValue("PartNumber"))
                txtEdon.Text = objMan.GetPropertyValue("PoweredOn").ToString()
                txtProduct.Text = objMan.GetPropertyValue("Product").ToString()
                txtSerial.Text = objMan.GetPropertyValue("SerialNumber").ToString()
                txtSKU.Text = Convert.ToString(objMan.GetPropertyValue("SKU"))

                txtStatus.Text = Convert.ToString(objMan.GetPropertyValue("Status"))
                txtTag.Text = Convert.ToString(objMan.GetPropertyValue("Tag"))
                txtVersion.Text = Convert.ToString(objMan.GetPropertyValue("Version"))
                txtWeight.Text = Convert.ToString(objMan.GetPropertyValue("Weight"))
                txtHeight.Text = Convert.ToString(objMan.GetPropertyValue("Height"))
                'txtPoweredon.Text = Convert.ToString(objMan.GetPropertyValue("Model"))
            Next
        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!")
        End Try
    End Sub
    Private Sub getHardiskDetails()
        Try
            Dim objMOS As New ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive")
            Dim objMan As ManagementObject
            For Each objMan In objMOS.Get
                txtHardiskModel.Text = objMan.GetPropertyValue("Model").ToString()
                txtInterfaceType.Text = objMan.GetPropertyValue("InterfaceType").ToString()
                txtHDCreationClass.Text = objMan.GetPropertyValue("CreationClassName").ToString()
                txtHDDescription.Text = objMan.GetPropertyValue("Description").ToString()
                txtHDInstallDate.Text = Convert.ToDateTime(objMan.GetPropertyValue("InstallDate"))
                txtHDManufacturer.Text = objMan.GetPropertyValue("Manufacturer").ToString()
                txtHDName.Text = objMan.GetPropertyValue("Name").ToString()
                'txtHDSerial.Text = objMan.GetPropertyValue("SerialNumber").ToString()
            Next
        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!")
        End Try
    End Sub
    Private Sub getOpticalDetails()
        Try
            Dim objMOS As New ManagementObjectSearcher("SELECT * FROM Win32_CDROMDrive")
            Dim objMan As ManagementObject
            For Each objMan In objMOS.Get

                txtOpCreationClass.Text = objMan.GetPropertyValue("CreationClassName").ToString()
                txtOpDescription.Text = objMan.GetPropertyValue("Description").ToString()

            Next
        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!")
        End Try
    End Sub
    Private Sub getProcessorDetails()
        Try
            Dim objMOS As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
            Dim objMan As ManagementObject
            For Each objMan In objMOS.Get
                'txtHardiskModel.Text = objMan.GetPropertyValue("Model").ToString()
                txtProcType.Text = Convert.ToInt16(objMan.GetPropertyValue("ProcessorType"))
                txtProcCreationClass.Text = objMan.GetPropertyValue("CreationClassName").ToString()
                txtProcDescription.Text = objMan.GetPropertyValue("Description").ToString()
                txtProcCaption.Text = objMan.GetPropertyValue("Caption").ToString()
                txtProcClockSpeed.Text = Convert.ToInt32(objMan.GetPropertyValue("CurrentClockSpeed"))
                txtProcDeviceID.Text = objMan.GetPropertyValue("DeviceID").ToString()
                txtProcId.Text = objMan.GetPropertyValue("ProcessorId").ToString()
                txtProcArchitecture.Text = Convert.ToInt16(objMan.GetPropertyValue("Architecture"))
                txtProcInstallDate.Text = Convert.ToDateTime(objMan.GetPropertyValue("InstallDate"))
                txtProcFamily.Text = Convert.ToInt16(objMan.GetPropertyValue("Family"))
                'txtProcNumberOfCores.Text = Convert.ToInt32(objMan.GetPropertyValue("NumberOfCores"))

            Next
        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!")
        End Try
    End Sub

Call it on button :

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        getMotherBoardDetails()
        getHardiskDetails()
        'getOpticalDetails()
        getProcessorDetails()
End Sub

you can see the result on pic

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.