It's a easy tutorial of how do a simple and useful "system of key" to insert on your trainer.
First add the following import's.
PHP Code:
using System.Management;
using System.Net;
So after add the function that will generate the key for each computer.
PHP Code:
ManagementObjectCollection mbsList = null; // ManagementObjectCollection is referenced from the .:Ref folder ->
ManagementObjectSearcher mbs = new ManagementObjectSearcher("Select * From Win32_processor");
mbsList = mbs.Get();
string id = "";
foreach (ManagementObject mo in mbsList)
{
SerialID = mo["ProcessorID"].ToString();//key done
textBox1.Text = (SerialID);//key will be loaded on a textbox
}
Now the "check function", you can add it on a button, checkbox, what you think better.
PHP Code:
try
{
string GrabCPUID = string.Empty;
WebClient webClient = new WebClient();//referenced by using System.Net;
string Key = null;
Key = webClient.DownloadString("http://example.com/example.txt");//there you define the host with .txt file that have the confirmed id's
webClient.Dispose();
if (Key.Contains(textBox2.Text))
{
// If the HWID is on .txt file will return this
MessageBox.Show("HWID Valid");
}
else
{
// If the HWID isn't on the .txt will return this.
MessageBox.Show("HWID Invalid");
}
}
catch (Exception)
{
// If not connected to the internet or can't connect with the site of .txt file will return this
MessageBox.Show("Unable To Retrieve HWID");
}