![]() |
|
HWID Show - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: HWID Show (/Thread-HWID-Show) |
HWID Show - Classified - 10-17-2015 Here is a small source that shows the person their HWID (Hardware ID) Code: Public Class ComputerInfo
Public Shared Function GetVolumeSerial(Optional ByVal strDriveLetter As String = "C") As String
Dim disk As ManagementObject = New ManagementObject(String.Format("win32_logicaldisk.deviceid=""{0}:""", strDriveLetter))
disk.Get()
Return disk("VolumeSerialNumber").ToString
End Function
Public Shared Function GetMACAddress() As String
Dim mc As ManagementClass = New ManagementClass("Win32_NetworkAdapterConfiguration")
Dim moc As ManagementObjectCollection = mc.GetInstances()
Dim MACAddress As String = String.Empty
For Each mo As ManagementObject In moc
If (MACAddress.Equals(String.Empty)) Then
If CBool(mo("IPEnabled")) Then
MACAddress = mo("MacAddress").ToString()
End If
End If
MACAddress = MACAddress.Replace(":", String.Empty)
Next
Return MACAddress
End Function
Public Shared Function GetProcessorId() As String
Dim strProcessorId As String = String.Empty
Dim query As New SelectQuery("Win32_processor")
Dim search As New ManagementObjectSearcher(query)
Dim info As ManagementObject
For Each info In search.Get
strProcessorId = info("processorId").ToString()
Next
Return strProcessorId
End Function
End ClassRE: HWID Show - Killpot - 10-17-2015 This doesn't do much for HWID as is, it simply returns 3 values, they still need to be combined together somehow. This also lacks in entropy, relying on only 3 parts of the computer aren't very unique, there's plenty other good functions out there for HWID generation, you should skim through them. |