Sep 29, 2011 06:42 PM
(This post was last modified: Sep 29, 2011 06:42 PM by Funhouse.)
Alright, so, I didn't really feel like actually putting this source together, so I decided that I'll just make a tutorial on how to make it. Bear with me, it's a simple process. The tutorial might be a little long, but that's just because I've got the habit of rambling on. Anyways!
You're gonna want to create 4 files that are going to be uploaded to a free hosting service (SPAM, BinHoster, etc.). The files are:
All of that may seem confusing, but once you get all of it put together, it'll make a lot more sense.
So now, we're going to put this code into useserial.php:
This basically takes the serial code that you give it and writes it to used.txt, so that it can't be used again.
Now we're going to put a very similar code into hwid.php:
Alright! Now all you have to do is put all of the different serial keys that you want to use into serials.txt.
So, now you need to upload all of these to your free web hosting service that I mentioned above.
Now it's time to make your application. Make a new project in VB.NET 2008, named whatever. On Form1, make one textbox, one label, and one button.
On Button1's text, make it "Register"
On Label1's text, make it "Status"
Now, go to Project, and then click on Add Reference. Find System.Management, click it, and then click OK.
Now double click on Form1's title bar or somewhere in the background, and the Form's coding should come up. On the very top, above "Public Class Form1", put this code:
And right under "Public Class Form1", insert this code:
All of that is how you're going to get the user's HWID. Now, right under "Private Sub Form1_Load..." you need to put this code:
Now, go back to Form1's designer and double-click Button1, the one that says "Register". Put the code:
Now you can go on ahead and test out your software! I'd try to wrap this thread up better, but I'm in a hurry, and I've already told everyone what I need to tell them.
Leave comments!
You're gonna want to create 4 files that are going to be uploaded to a free hosting service (SPAM, BinHoster, etc.). The files are:
- useserial.php - This is the file that we're going to use when someone uses a serial key.
- hwid.php - This file is going to log the HWID of the user after they use a serial key.
- serials.txt - This file will contain a bunch of different serial keys that are valid. These will be the serial keys that you give to your customers or whoever wants to register your software.
- hwid.txt - This file will be the log of all people who have already registered your software, so they don't have to register their software every time they open it.
- used.txt - This file will contain all of the already used serial keys, so that they can't be used more than once.
All of that may seem confusing, but once you get all of it put together, it'll make a lot more sense.
So now, we're going to put this code into useserial.php:
PHP Code
<?php
$serial = $_GET["serial"];
$fh = fopen("used.txt", 'a');
fwrite($fh, $serial . "\n");
fclose($fh);
?>This basically takes the serial code that you give it and writes it to used.txt, so that it can't be used again.
Now we're going to put a very similar code into hwid.php:
PHP Code
<?php
$hwid = $_GET["id"];
$fh = fopen("hwid.txt", 'a');
fwrite($fh, $hwid . "\n");
fclose($fh);
?>Alright! Now all you have to do is put all of the different serial keys that you want to use into serials.txt.
So, now you need to upload all of these to your free web hosting service that I mentioned above.
Now it's time to make your application. Make a new project in VB.NET 2008, named whatever. On Form1, make one textbox, one label, and one button.
On Button1's text, make it "Register"
On Label1's text, make it "Status"
Now, go to Project, and then click on Add Reference. Find System.Management, click it, and then click OK.
Now double click on Form1's title bar or somewhere in the background, and the Form's coding should come up. On the very top, above "Public Class Form1", put this code:
Code
Imports System.Management
Imports System.NetAnd right under "Public Class Form1", insert this code:
Code
Dim cpuInfo As String 'This is required
Function GetHWID()
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
Return cpuInfo
End FunctionAll of that is how you're going to get the user's HWID. Now, right under "Private Sub Form1_Load..." you need to put this code:
Code
Dim client As WebClient = New WebClient()
Dim registeredhwids As String = client.DownloadString("http://yourfreewebhosting.com/hwid.txt")
If registeredhwids.Contains(GetHWID) Then
Label1.Text = "Software Registered!"
End IfNow, go back to Form1's designer and double-click Button1, the one that says "Register". Put the code:
Code
Dim serial As String = Textbox1.Text
Dim client As WebClient = New WebClient()
Dim usedserials As String = client.DownloadString("http://yourfreewebhosting.com/used.txt")
If usedserials.Contains(serial) Then
Msgbox("Registration failed. This serial key has already been used.")
Return
End If
Dim client1 As WebClient = New WebClient()
Dim serials As String = client.DownloadString("http://yourfreewebhosting.com/serials.txt")
If serials.Contains(serial) = False Then
Msgbox("Registration failed. This serial key is not valid.")
Return
End If
Msgbox("Your software has been registered!")
Dim z as new WebBrowser
z.Navigate("http://yourfreewebhosting.com/useserial.php?serial=" + serial)
Dim d as new WebBrowser
d.Navigate("http://yourfreewebhosting.com/hwid.php?id=" + GetHWID)Now you can go on ahead and test out your software! I'd try to wrap this thread up better, but I'm in a hurry, and I've already told everyone what I need to tell them.
Leave comments!




![[Image: RtaNL.png]](https://i.imgur.com/RtaNL.png)