Simple Login Screen
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.
10 posts
Page 1 of 1
Hi All
I just thought i would post a little simple tutorial that will help those who are starting out in programming. This is a very Easy Tutorial but works really well never the less
You can change the Username and Passwords to what ever you like, I have just used "Admin" and "Login" just to show you how it works
You can use this as a Login Screen for your Applications
Or you can just use 1 Textbox as a password/Serial Number Field
and just take out the code for the Textbox2
Like this example Code below which you use just one Textbox
This Code Below is for using 2 Texboxes Like in the Picture Below
Create 2 new Windows forms
On the Ist Form
add 2 Textboxes
and 2 Buttons
and 2 Labels
Arrange them Like the picture Below ( or however you want)
![Image]()
Add this code to the Login Button
On the 2nd Form ( i have just added a Label to say Welcome back)
But you can have this as your main application Window or whatever you like)
![Image]()
See i told you it was very simple
But its really Effective and they wont be able to use your Program if they dont know the code that you set :lol:
Here is another Example of a Serial Number Login Screen which might be of use.
You can change the 24 digit codes to what you like, As before you have 2 Forms and the code goes on the Enter button on the first form. *( You can use as many Digits as you like, I have just used 24 for this example, You can use Letters instead of Numbers or Mix Letters with Numbers as well )
![Image]()
Code for the Enter Button![Image]()
Or if the Wrong Serial is used
![Image]()
I just thought i would post a little simple tutorial that will help those who are starting out in programming. This is a very Easy Tutorial but works really well never the less

You can change the Username and Passwords to what ever you like, I have just used "Admin" and "Login" just to show you how it works
You can use this as a Login Screen for your Applications
Or you can just use 1 Textbox as a password/Serial Number Field
and just take out the code for the Textbox2
Like this example Code below which you use just one Textbox
Code: Select all
This can be done in VB 6.0 and VB 2005/2008 and 2008 Express Edition.If TextBox1.Text = "89765645321" Then
MsgBox("Welcome to My Program")
Me.Hide()
form2.show()
Else
MsgBox("You have entered a wrong Serial code, Try again!")
End If
This Code Below is for using 2 Texboxes Like in the Picture Below
Create 2 new Windows forms
On the Ist Form
add 2 Textboxes
and 2 Buttons
and 2 Labels
Arrange them Like the picture Below ( or however you want)

Add this code to the Login Button
Code: Select all
Add this code to the Exit Button
If TextBox1.Text = "Admin" And TextBox2.Text = "Login" Then
MsgBox("You are Logged in")
Me.Hide()
form2.show()
Else
MsgBox("You have entered a wrong Username and/or Password, Try again!")
End If
Code: Select all
Me.Close()
On the 2nd Form ( i have just added a Label to say Welcome back)
But you can have this as your main application Window or whatever you like)

See i told you it was very simple

But its really Effective and they wont be able to use your Program if they dont know the code that you set :lol:
Here is another Example of a Serial Number Login Screen which might be of use.
You can change the 24 digit codes to what you like, As before you have 2 Forms and the code goes on the Enter button on the first form. *( You can use as many Digits as you like, I have just used 24 for this example, You can use Letters instead of Numbers or Mix Letters with Numbers as well )

Code for the Enter Button
Code: Select all
If TextBox1.Text = "552211" And TextBox2.Text = "990022" And TextBox3.Text = "118866" And TextBox4.Text = "995522" Then
MsgBox("Serial Number Accepted, Thank You")
Me.Hide()
Form2.Show()
Else
MsgBox("Invalid Serial Number, Please Contact the Program Vendor")
End If

Or if the Wrong Serial is used

Last edited by hungryhounduk on Fri Sep 11, 2009 8:45 pm, edited 1 time in total.
Hi Todaysgeek
Yeah its such a simple bit of code but it works really well cooll;
I hope you all make use of these code snippets and tutorials to make some really interesting programs and Projects 8-)
Regards
Chris
Yeah its such a simple bit of code but it works really well cooll;
I hope you all make use of these code snippets and tutorials to make some really interesting programs and Projects 8-)
Regards
Chris
LoL - Check out CodemaN - keeps spamming even though he is denied VIP
--
Nice! This was the first program i learned :]
--
Nice! This was the first program i learned :]
mylescomputer wrote:This Is Cool!!!This is not cool! :oops: This is amazing!
Agree with above but it is easy to crack"Is that so"
Why dont YOU post a Tutorial on How to STOP people Cracking it ;)
10 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023