Imports System.Management
Imports System.Net
Public Class Form1
Private Function GETHWID() As String
Dim cpuInfo 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 cpuInfo = "" Then
cpuInfo = mo.Properties("processorID").Value.ToString()
Exit For
End If
Next
GETHWID = cpuInfo
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = GETHWID()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim wc As New WebClient
Dim strings As String
strings = wc.DownloadString("http://555.com/hwid.txt")
wc.Dispose()
If strings.Contains(GETHWID) Then
MsgBox("HWIDถูก")
Else
MsgBox("HWIDผิด")
End If
End Sub
End Class