Key registration (Very noooooob) (EDIT)
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
7 posts
Page 1 of 1
Hi guys,
I wanted to make a program with a key you have to fill in. But if you just take the easy way (like this):
So thats, quite stupid.. :P
I found a (very weird) way to make him not ask it if you already filled the good key.
OMG. This english is really hard xD Sorry about that.
Uhmn yeah.
what did I do, I used 1 textbox and 1 button.
If you double-click the button, fill in this code:
With the following code, he'll check if the directory exists, when you start your program.
I only have a small problem, I wanted it to hide for 1 if he found the dir but he don't do it. I don't really understand why thats why you'll still have the form1.
You just have to click oK whitout entering the key.
I know it's hard to read :P So I hope you understand.
If you have a comment, i'll read it, but don't say stupid things like: your english sucks (i know) or your a noob (I am, i know). :P
Edit:
I the whole code to:
Ilenkaa
I wanted to make a program with a key you have to fill in. But if you just take the easy way (like this):
Code: Select all
Everytime you start up your little program, he'll ask the key again.if textbox1.text = "thecode" or "theothercode" then
form2.show()
else
messagebox.show("Wrong code!")
So thats, quite stupid.. :P
I found a (very weird) way to make him not ask it if you already filled the good key.
OMG. This english is really hard xD Sorry about that.
Uhmn yeah.
what did I do, I used 1 textbox and 1 button.
If you double-click the button, fill in this code:
Code: Select all
It makes a directory when you filled in the right code. Everytime you'll starrt the program he'll check if that directory exist. If it doesn't, he'll ask for the key. So, as long as you don't delete the directory in :C\namedir\, he won't ask for the key.Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "thiscode" Then
MkDir("C:\namedir\" + TextBox1.Text + "\")
MsgBox("You succesfully registered this program.")
Me.Hide()
Form2.Show()
Else
' If don't do anything.
End If
If My.Computer.FileSystem.DirectoryExists("C:\namedir\thiscode\") And TextBox1.Text = "" Then
Me.Hide()
Form3.Show()
End If
End Sub
With the following code, he'll check if the directory exists, when you start your program.
Code: Select all
Uhmn. It's quite stupid, but it works. Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Computer.FileSystem.DirectoryExists("C:\namedir\thiscode\") Then
' If dir exist, show form2 and hide form1.
Me.Hide()
Form2.Show()
Else
' Don't do anything.
End If
End Sub
I only have a small problem, I wanted it to hide for 1 if he found the dir but he don't do it. I don't really understand why thats why you'll still have the form1.
You just have to click oK whitout entering the key.
I know it's hard to read :P So I hope you understand.
If you have a comment, i'll read it, but don't say stupid things like: your english sucks (i know) or your a noob (I am, i know). :P
Edit:
I the whole code to:
Code: Select all
Don't watch the dutch text. I didn't have the time to change it to english. Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If (Not (My.Computer.FileSystem.DirectoryExists("C:\naamvprogramma\geregistreerd\"))) Then
' Als de code nog niet werd ingegeven; vraag om de serial
Dim serial As String = ""
While (Not (serial.Equals("12FZ-A269-5RK1-7SLL")))
serial = InputBox("Geef a.u.b. de juiste key in:")
End While
' de user heeft nu de juiste serial ingegeven -> maak de directory
MkDir("C:\naamvprogramma\geregistreerd\")
End If
End Sub
End Class
Ilenkaa
Last edited by iLenkaa on Sat Nov 27, 2010 3:07 pm, edited 2 times in total.
Nice work, I wanted to know how to make a file to create a text file and then load it. And you've helped me so I appreciate it.
Hey Ilenkaa
a very good Tutorial
nice one keep it up
Chris
a very good Tutorial

nice one keep it up
Chris
Usman55 wrote:Nice work, I wanted to know how to make a file to create a text file and then load it. And you've helped me so I appreciate it.No problem! xD
is nice but this will work better if you use registry keys to store your code is much safer this way if you want to protect your more advanced programs.
Still very nice Tutorial Keep it up!
Still very nice Tutorial Keep it up!
You can find me on Facebook or on Skype mihai_92b
It's quite messy so I'll reorganize it when I find some time.
7 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023