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
Contributors
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Simple Login Screen
hungryhounduk
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
Code: Select all
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 can be done in VB 6.0 and VB 2005/2008 and 2008 Express Edition.

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
Code: Select all
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
Add this code to the Exit Button
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)

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
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
Image

Or if the Wrong Serial is used
Image
Last edited by hungryhounduk on Fri Sep 11, 2009 8:45 pm, edited 1 time in total.
Image
User avatar
todaysgeek
Just Registered
Just Registered
Posts: 4
Joined: Fri Sep 11, 2009 7:36 pm

Re: Simple Login Screen
todaysgeek
Nice!
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Re: Simple Login Screen
hungryhounduk
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
Image
User avatar
CodemaN
VIP Access - Denied
VIP Access - Denied
Posts: 74
Joined: Fri Sep 18, 2009 3:18 pm

Re: Simple Login Screen
CodemaN
fantastick program!!!
User avatar
mylescomputer
Just Registered
Just Registered
Posts: 7
Joined: Fri Sep 04, 2009 7:39 pm

Re: Simple Login Screen
mylescomputer
This Is Cool!!!
User avatar
Diazepa
VIP - Donator
VIP - Donator
Posts: 70
Joined: Sat Sep 12, 2009 11:38 pm

Re: Simple Login Screen
Diazepa
LoL - Check out CodemaN - keeps spamming even though he is denied VIP

--

Nice! This was the first program i learned :]
User avatar
Nery
Co-Admin Moderator
Co-Admin Moderator
Posts: 1117
Joined: Mon Sep 07, 2009 8:11 pm

Re: Simple Login Screen
Nery
That's an old reply from CodemaN ^^
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: Simple Login Screen
Usman55
mylescomputer wrote:
This Is Cool!!!
This is not cool! :oops: This is amazing!
Image
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Simple Login Screen
Lewis
Agree with above but it is easy to crack
Image
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Re: Simple Login Screen
hungryhounduk
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 ;)
Image
10 posts Page 1 of 1
Return to “Tutorials”