Tutorials Navigation

Tutorials :: New :: Popular :: Top Rated

Tutorials: 18,357 Categories: 12

Total Tutorial Views: 42,453,298

[VB.NET] How to Make a Login for Your Application

Tutorial Name: [VB.NET] How to Make a Login for Your Application  

Category: PC Tutorials

Submitted By: Maj

Date Added:

Comments: 2

Views: 1,598

Related Forum: PC Building Forum

Share:

As the title states, this tutorial will walk you through step by step on how to make a good log in for your application (This is basic) which allows users to setup their own accounts!!

Step1. Make a form and add 2 Textbox's, 2 Button's & 2 Labels. Make Textbox1 the username text & Textbox2 the password text (This is just to stay organised)
It should look something like this when done

[ Register or Signin to view external links. ]


Step2. Make another form (This is for existing users) and add 2 Label's, 2 Textbox's & 1 Button. Now make textbox1 handle the username & textbox2 handle the password. Just like we did above. Now you should have something like the image shown below

[ Register or Signin to view external links. ]


Step3. Go to your application's properties & navigate to the settings tab. Click on the first row and in the first column add 'Username'. Now go down to the second row & add 'Password'. It should look like the image down below!!

[ Register or Signin to view external links. ]


Step4. Now were going to start adding all the code, as we have finished the design side of things!! Navigate to Form 1, now double click your register button and add the following code

 My.Settings.Username = TextBox1.Text
        My.Settings.Password = TextBox2.Text
        MsgBox("Successfully Created the Account " + TextBox1.Text, MsgBoxStyle.Information)
        Form3.Show()
        Me.Hide()
        My.Settings.Save()


Now it should look something like this

[ Register or Signin to view external links. ]


Step5. Go back to your Form 1, Now double click the Log In button. Then add the following code

Me.hide
Form3.show <- This will be your actual application


When that's done it should look something like this

[ Register or Signin to view external links. ]


Step6. You're almost done!! Now, for the Log in button (On form 2) we need to make it functional!! So go ahead and add the following code

If TextBox1.Text = My.Settings.Username And TextBox2.Text = My.Settings.Password Then
            MsgBox("Successfully Logged In!!", MsgBoxStyle.Information)
            Me.Hide()
            Form3.Show()
        Else
            MsgBox("Incorrect Username or Password!!, Please try again", MsgBoxStyle.Critical)
        End If


Now it should look something like this

[ Register or Signin to view external links. ]


Now, You're all done & your log in / registration for your application should work!! If you are having issues with this & cannot get it to work (or other issues) feel free to PM me! I'm always happy to help

Ratings

Current rating: 5.20 by 5 users
Please take one second and rate this tutorial...

Not a Chance
1
2
3
4
5
6
7
8
9
10
Absolutely

Comments

"[VB.NET] How to Make a Login for Your Application" :: Login/Create an Account :: 2 comments

If you would like to post a comment please signin to your account or register for an account.

MajPosted:

Giga I'll give it a go. Low ratings have me skeptical though.


Probably due to the fact that its very basic and not too secure

GigaPosted:

I'll give it a go. Low ratings have me skeptical though.