05-13-2010, 03:21 PM
C# Hwid Lock, No encryption method or anything more, just checking the HWID.
Using;
Project > Add Reference, Click the .NET Tab and find "System.Management" Click it then press ok, Now enter this code into Form1_Load (or what ever your form's named)
Using;
Code:
using System;
using System.Management;
using System.Windows.Forms;
Project > Add Reference, Click the .NET Tab and find "System.Management" Click it then press ok, Now enter this code into Form1_Load (or what ever your form's named)
Code:
string cpuInfo = string.Empty;
ManagementClass mc = new ManagementClass("win32_processor");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
if (cpuInfo == "")
{
cpuInfo = mo.Properties["processorID"].Value.ToString();
break;
}
}
System.Net.WebClient Wc = new System.Net.WebClient();
string hwid = Wc.DownloadString("http://www.YourSite.com/Hwid.txt");
if (hwid.Contains(cpuInfo))
{
}
else
{
MessageBox.Show("Your HWID Doesn't exist in our database");
Environment.Exit(-1);
}
Wc.Dispose();