01-31-2012, 21:49
Hey all
s,
I was making today simple login form, thought I'd share it with you.
Keep in mind that it shouldn't be hard to crack, so don't use it if you want good protection.
Usages
So, let's get things started.
First start with making some nice GUI, like this :
![[Image: QeLlJn9sbr.png]](http://i.nowfollow.nl/QeLlJn9sbr.png)
If you want to, make textlabel under Login! button to show if login failed or not.
Set the property of password textboxUseSystemPasswordChar to true
![[Image: lKcgacFfNb.png]](http://i.nowfollow.nl/lKcgacFfNb.png)
This will prevent anyone from seeing your password.
Now, let's write some code. We want it to work like this :
![[Image: 6VJsQM8X1l.png]](http://i.nowfollow.nl/6VJsQM8X1l.png)
Let's get started double clicking the 'Login!' button and adding the code checking if username / password is valid. TextBox1 is login and TextBox2 is password.
Next thing we might like to add is what the program should do, if username / password does not match the set ones. I will use the code from above.
If you have a basic knowledge in any programming language, you should be able to understand what the code does. If not, explanation is here.\
This line check if text in textbox1 is equal to "Orange" and the text in textbox2 is equal to "orange" which is my password. The && makes that 'Login succesfull' will pop up only if both arguments are valid.
If something does not match our pw / login, user will get a nice 'Invalid login' box.
That's it, hope you enjoyed the tutorial. If something's not clear, feel free to ask in the thread.
Don't forget to press that
button for more releases or tutorials! 
s,I was making today simple login form, thought I'd share it with you.
Keep in mind that it shouldn't be hard to crack, so don't use it if you want good protection.
Usages
- trolling brother / sister
- trolling IT teacher
- general protection of your applications from unwanted viewers

So, let's get things started.
First start with making some nice GUI, like this :
![[Image: QeLlJn9sbr.png]](http://i.nowfollow.nl/QeLlJn9sbr.png)
If you want to, make textlabel under Login! button to show if login failed or not.
Set the property of password textboxUseSystemPasswordChar to true
![[Image: lKcgacFfNb.png]](http://i.nowfollow.nl/lKcgacFfNb.png)
This will prevent anyone from seeing your password.
Now, let's write some code. We want it to work like this :
![[Image: 6VJsQM8X1l.png]](http://i.nowfollow.nl/6VJsQM8X1l.png)
Let's get started double clicking the 'Login!' button and adding the code checking if username / password is valid. TextBox1 is login and TextBox2 is password.
C++ Code
- if(this->TextBox1->Text == "Orange" && this->TextBox2->Text == "orange")
- {
-
- MessageBox::Show("Login succesfull!");
- //do stuff
- }
Next thing we might like to add is what the program should do, if username / password does not match the set ones. I will use the code from above.
C++ Code
- if(this->TextBox1->Text == "Orange" && this->TextBox2->Text == "orange")
- {
-
- MessageBox::Show("Login succesfull!");
- //do stuff
- }
- else
- {
- MessageBox::Show("Invalid login or password! Please try again!");
- }
If you have a basic knowledge in any programming language, you should be able to understand what the code does. If not, explanation is here.\
C++ Code
- if(this->TextBox1->Text == "Orange" && this->TextBox2->Text == "orange")
This line check if text in textbox1 is equal to "Orange" and the text in textbox2 is equal to "orange" which is my password. The && makes that 'Login succesfull' will pop up only if both arguments are valid.
If something does not match our pw / login, user will get a nice 'Invalid login' box.
That's it, hope you enjoyed the tutorial. If something's not clear, feel free to ask in the thread.
Don't forget to press that
button for more releases or tutorials! 
![[Image: 6cum0.jpg]](http://i.imgur.com/6cum0.jpg)