How to get a unique PC ID?

  • What is a unique PC identifier?
  • How can we get the unqiue computer id?
  • Is this about the hard drive or the motherboard?

I want to save the PC ID in my window program. Please share me.

+5
source share
4 answers

This work is for me.

Private Function CpuId() As String
    Dim computer As String = "."
    Dim wmi As Object = GetObject("winmgmts:" & _
        "{impersonationLevel=impersonate}!\\" & _
        computer & "\root\cimv2")
    Dim processors As Object = wmi.ExecQuery("Select * from " & _
        "Win32_Processor")

    Dim cpu_ids As String = ""
    For Each cpu As Object In processors
        cpu_ids = cpu_ids & ", " & cpu.ProcessorId
    Next cpu
    If cpu_ids.Length > 0 Then cpu_ids = _
        cpu_ids.Substring(2)

    Return cpu_ids
End Function

see here

+6
source

“Unique PC Identifier” usually means a hardware identifier used to uniquely identify a computer. For example, they can be used to track software usage on computers.

, " , BIOS" " , ".

#; , VB.NET, .

0

, .

Dim win32MgmtClass as System.Management.ManagementClass
win32MgmtClass = new System.Management.ManagementClass("Win32_Processor")
Dim processors as System.Management.ManagementObjectCollection
processors = win32MgmtClass.GetInstances()

For Each processor As System.Management.ManagementObject In processors
    MessageBox.Show(processor("ProcessorID").ToString())
Next
0

, , . , , , , .

, Windows .

HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices \DosDevices\C: (, C: - , , , ).

, , UUID, . : http://www.windowsnetworking.com/articles_tutorials/Deploying-Windows-7-Part18.html Windows. http://blog.granneman.com/2007/07/26/find-out-a-hard-drives-uuid/ Linux.

: v++

0

All Articles