First of all I want to make it clear that I'm no "PRO" at visual basic, neither c#. But I had this question for a few days in my head.
"Is it possible to verify HWID before a form load? And how it works?"
Since I'm creating a software for a local gym, I would like to implement some security, not just a basic "login form". So, it brings me to this question... How can i create a simple way to get the HWID from the CPU and verify from a plain text(maybe encripted with md5 hash) if the same value is on that list? I was looking for some explanation on how to do it and how to implement it on both VB.NET and C#.
Private Sub frmprincipal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim janela As New frmLogin
janela.MdiParent = Me
janela.Show()
Label4.Text = "Faça login!"
tmrRelogio.Enabled = True
bttLogout.Enabled = False
bttLogout.Visible = False
Dim hwid 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 hwid = "" Then
hwid = mo.Properties("processorID").Value.ToString()
Exit For
End If
Next
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://www.dropbox.com/s/zewro4zubg9qc1s/HWID.txt")
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim hwidcheck As String = sr.ReadToEnd
If hwidcheck.Contains(hwid) Then
MsgBox("This is the original copy!", "INFORTGEI", MessageBoxButtons.OK)
If DialogResult.OK = True Then
Close()
End If
Else
MsgBox("Contact the admin to activate the copy!", MessageBoxButtons.OK, "INFORTGEI")
End If
End Sub
Any advices?
Thanks in advance.