Serials?

Posts 1–15 of 20 · Page 1 of 2
Serials?
How could I implement a serial/key into my program?

Something that makes you require a serial in order to authenticate the program.

Any halp?
Well, you've always got the;

" If "Serial Code" = True Then
Button1.Enabled = True

But thats the simple version.
What you'll need is the 1-time only usable Serial key, and also more than one o.o.
NEXTGEN!!!
Nextgen gave me an FTP server. You can use it too. Give me 10-15 minutes, and I'll make the serial authentication program for you.
Oh wicked. Does that mean its a free source?
Quote Originally Posted by Invidus View Post
Oh wicked. Does that mean its a free source?
If you mean Nextgen gave it to me for free ?? Then yes, xD

Edit: Damn it...I think NextGen deleted that Now I don't have that anymore.
I have a ftp where I could upload stuff for you guys.
Make a separate program that only you can use. In this program, you'll add the user to the server which will be allowed by our main application.

First add these subs in the program. These will make random serials / keys:

Private Function RandomString( ByVal size As Integer , ByVal lowerCase As Boolean ) As String
Dim builder As New StringBuilder()
Dim random As New Random()
Dim ch As Char
Dim i As Integer
For i = 0 To size - 1
ch = Convert.ToChar(Convert.ToInt32((26 * random.NextDouble() + 65)))
builder.Append( ch )
Next
If lowerCase Then
Return builder.ToString().ToLower()
End If
Return builder.ToString()
End Function

Private Function RandomNumber( ByVal min As Integer , ByVal max As Integer ) As Integer
Dim random As New Random()
Return random. Next (min,max)
End Function


Then create a new sub and add the following code in it:

Dim x As String = My.Computer.FileSystem.GetTempFileName() & Rnd() * 77777999
My.Computer.Network.DownloadFile( "http://www.yourwebsite.com/Lolland/Serials.txt",x, "", "", False ,1000000, True )
Dim s As String = "User:" & TextBox1.Text & vbCrLf & "Serial:" & RandomString(6, True ) & "x" & RandomNumber(1,10000000)
My.Computer.FileSystem.WriteAllText(x,vbCrLf & s , True )
My.Computer.Network.UploadFile(x, "ftp:/rwebsite.com/Lolland/Serials.txt", "username", "password", False ,1000000,FileIO.UICancelOption.DoNothing)
My.Computer.FileSystem.DeleteFile(x,FileIO.UIOptio n.OnlyErrorDialogs,FileIO.RecycleOption.DeletePerm anently,FileIO.UICancelOption.DoNothing)


Replace yourwebsite with your FTP website details. Uptill now you'll add the username to your database.

Now on the load event of the main form (Of the application that user will use. I mean the main application), add the following:

Dim authenticated As Boolean = False
Dim file As String = "http://www.yourwebsite.com/Lolland/Serials.txt"
Dim x As String = My.Computer.FileSystem.GetTempFileName() & Rnd() * 77777999
My.Computer.Network.DownloadFile(file,x, "", "", False ,1000000, True )
Dim c As String = My.Computer.FileSystem.ReadAllText(file)
For Each n As String In c .Split(vbCrLf)
Dim a() As String = n .Split( ":")
If a(0) = vbNullString Or a(1) = vbNullString Then
Continue For
End If
If a(0) = "User" Then
If Not username.text = a(1) Then
MsgBox( "Username doesn't exist.")
Exit Sub
End If
Else
If Not password.text = a(1) Then
MsgBox( "Password / serial doesn't match. Enter again...")
Exit Sub
Else
authenticated = True
End If
End If
Next
My.Computer.FileSystem.DeleteFile(x,FileIO.UIOptio n.OnlyErrorDialogs,FileIO.RecycleOption.DeletePerm anently,FileIO.UICancelOption.DoNothing)
If Not authenticated Then
MsgBox( "You are not allowed to enter .... blah blah blah...")
Exit Sub
End If


Replace username and password with the textboxes you are using to authenticate. This will download the database file and will see if the details matches. Ask blubb if he can provide you and FTP server. If so, this will work great as your authentication program. Hope this helps.
Quote Originally Posted by Hassan View Post
Make a separate program that only you can use. In this program, you'll add the user to the server which will be allowed by our main application.

First add these subs in the program. These will make random serials / keys:

Private Function RandomString( ByVal size As Integer , ByVal lowerCase As Boolean ) As String
Dim builder As New StringBuilder()
Dim random As New Random()
Dim ch As Char
Dim i As Integer
For i = 0 To size - 1
ch = Convert.ToChar(Convert.ToInt32((26 * random.NextDouble() + 65)))
builder.Append( ch )
Next
If lowerCase Then
Return builder.ToString().ToLower()
End If
Return builder.ToString()
End Function

Private Function RandomNumber( ByVal min As Integer , ByVal max As Integer ) As Integer
Dim random As New Random()
Return random. Next (min,max)
End Function


Then create a new sub and add the following code in it:

Dim x As String = My.Computer.FileSystem.GetTempFileName() & Rnd() * 77777999
My.Computer.Network.DownloadFile( "http://www.yourwebsite.com/Lolland/Serials.txt",x, "", "", False ,1000000, True )
Dim s As String = "User:" & TextBox1.Text & vbCrLf & "Serial:" & RandomString(6, True ) & "x" & RandomNumber(1,10000000)
My.Computer.FileSystem.WriteAllText(x,vbCrLf & s , True )
My.Computer.Network.UploadFile(x, "ftp:/rwebsite.com/Lolland/Serials.txt", "username", "password", False ,1000000,FileIO.UICancelOption.DoNothing)
My.Computer.FileSystem.DeleteFile(x,FileIO.UIOptio n.OnlyErrorDialogs,FileIO.RecycleOption.DeletePerm anently,FileIO.UICancelOption.DoNothing)


Replace yourwebsite with your FTP website details. Uptill now you'll add the username to your database.

Now on the load event of the main form (Of the application that user will use. I mean the main application), add the following:

Dim authenticated As Boolean = False
Dim file As String = "http://www.yourwebsite.com/Lolland/Serials.txt"
Dim x As String = My.Computer.FileSystem.GetTempFileName() & Rnd() * 77777999
My.Computer.Network.DownloadFile(file,x, "", "", False ,1000000, True )
Dim c As String = My.Computer.FileSystem.ReadAllText(file)
For Each n As String In c .Split(vbCrLf)
Dim a() As String = n .Split( ":")
If a(0) = vbNullString Or a(1) = vbNullString Then
Continue For
End If
If a(0) = "User" Then
If Not username.text = a(1) Then
MsgBox( "Username doesn't exist.")
Exit Sub
End If
Else
If Not password.text = a(1) Then
MsgBox( "Password / serial doesn't match. Enter again...")
Exit Sub
Else
authenticated = True
End If
End If
Next
My.Computer.FileSystem.DeleteFile(x,FileIO.UIOptio n.OnlyErrorDialogs,FileIO.RecycleOption.DeletePerm anently,FileIO.UICancelOption.DoNothing)
If Not authenticated Then
MsgBox( "You are not allowed to enter .... blah blah blah...")
Exit Sub
End If


Replace username and password with the textboxes you are using to authenticate. This will download the database file and will see if the details matches. Ask blubb if he can provide you and FTP server. If so, this will work great as your authentication program. Hope this helps.
holly crap... awesome!
Quote Originally Posted by Hassan View Post
Epically helpful post.
Thanks ALOT.

My original idea was to have a username then password which would be stored in a txt file on one of my yola sites.

The only problem I saw in that is if I sell 50 programs a day all with unique passwords and usernames, then I'd be updating that list EVERY DAY D:

Your solution solves that.

Thanks alot!
Quote Originally Posted by Lolland View Post
Thanks ALOT.

My original idea was to have a username then password which would be stored in a txt file on one of my yola sites.

The only problem I saw in that is if I sell 50 programs a day all with unique passwords and usernames, then I'd be updating that list EVERY DAY D:

Your solution solves that.

Thanks alot!

No problem at all. Adding a user manually is a a very dull approach especially if you have a large number of users.

Did you find a server for uploading ?
I'm still looking

I'd like to speak with Blubb but it's almost midnight in Germany, so he's probably not gonna be online until tomorrow.
Exactly xD Going offline nao

Talking to you tomorrow.
well, you could say if the file is = nothing then
msg.send(blalala HWID)
else
check HWID (im lazy now)
if file <> HWID then
msgbox(DENY)
else
msgbox(ACCEPT)
end if
end if
Posts 1–15 of 20 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?