Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    thijsduijker's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    368
    Reputation
    44
    Thanks
    185
    My Mood
    Doh

    Talking Simple Login Application || Easy 3/10 || Pictures

    Hello everyone.

    I will be doing some tutorials for Visual Basic, this is the first.
    Today i'm going to show you how to make a simple login application.
    This can be used to "protect" your application or just to learn some more Visual Basic.

     
    - English Knowledge.
    - Microsoft Visual Studio Express 2012 (this can be get with a quick google).
    - A brain.


    First of all, install and open Microsoft Visual Studio Express 2012.

    Click File.


    New project.


    Select Windows form application and enter a name for your application.


    Go into Properties, and scroll untill you see "Appearance" and go down in that section and change where it says Text and change Form1 to Login, or Please Login.
    What you'll enter here will be at the top, as title.


    Now we have setup everything yay.
    What we are going to do now, is make our application design.
    Go into Toolbox (Most times on the right of the screen, hover over it else go to View -> Just below the middle and click Toolbox.)
     
    2 labels, no linklabels just labels.
    2 Textboxes, no Richtextbox just textboxes.
    1 Button.


    Just click on the "Tool" you need, and drag it into your program.
    When you're done with dragging everything in, make a design like this to make it easy for users to understand.



    You can make things larger by clicking on them, and holding the little dots and dragging them to how big you want it to be.

    Now we are going to rename everything so it looks logical.
    Renaming is done the same as we did change the Title/Form name.
    Label1 to Username:
    Label2 to Password:
    Button1 to Login!
    Easy!
    It'll look like this.



    The design is ready, now the coding part.

    What we want to do is make a login application so we need to think of how a login system works.
    It's very simple, it works with If statements, here is a explanation.
    If Textbox1 Text equals Hello and Textbox2 equals World Then Messagebox show Welcome to the program.
    Else Messagebox show Wrong Username/Password.

    So what we want to do is check if the username and password is entered correct if the button is pressed.
    Now we are going to do some easy coding.
    Double-click the Login! button.
    You'll see something similar to this.



    Explanation:
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    End Sub

    This means, that if the Button1 is clicked (Login! button) it will execute the "commands" in the empty part.
    The "commands" we will be making in there are to check if the Username and password are right.

    This can be done with some easy If statements

    We'll start,
    In the empty space between Private Sub and End Sub, we'll start our If statement.
    Simply type If
    You'll see 2 errors coming up, that doesn't matter we'll fix them.

    So now we will check if the username and password are right.
    So,

    Code:
    If Textbox1.Text = "Hello"
    If Textbox1 Text equals Hello
    This is the start, it now checks if "Username"/Textbox1 text is Hello.

    Code:
    If Textbox1.Text = "Hello" And Textbox2.Text = "World"
    It now checks if "Username"/Textbox1 text is Hello and "Password/Textbox2" text is World.
    We got the check, but it still does nothing, so add Then, this will say what it is going todo if Textbox1 equals Hello and Textbox2 equals World.

    Code:
    If Textbox1.Text = "Hello" And Textbox2.Text = "World" Then
    Press Enter and it will automaticaly write End If, if it doesn't make it look like this.



    Now we are going to tell the application what to do if Textbox1 equals Hello and Textbox2 equals World.
    There are a lot of things we can do if the username and password is entered correct.
    We'll make a Messagebox popup if the info is entered correctly.
    So we'll be adding this code to make the messagebox popup.

    Code:
    MessageBox.Show("")
    After the .Show there are (""), these mean what the messagebox displays.
    You can set it to Username and Password entered correctly.
    Or anything you want, it only has to be between the "".

    Now we will have this
    Code:
    MessageBox.Show("Username and Password entered correctly.")
    Want a titled messagebox? do this:
    Code:
    MessageBox.Show("Username and Password entered correctly.", "Your title")
    Replace Your Title with the title you want, like Correct!

    After this is done, the code should look like this:



    Right now, test your application.
    By pressing F5 or clicking this:



    As you see, it works.
    But, if the wrong username/password is entered it does nothing, let's change that so it'll say: Wrong username/password.

    Code:
    MessageBox.Show("Username and Password entered correctly.", "Your title")
    Make some space for code under here, so press enter.

    Type:
    Code:
    Else
    Here we'll show a messagebox, like we did earlier but now with Wrong Password/Username, try again.

    Code:
    Else
             MessageBox.Show("Wrong Password/Username, try again.", "Failed to Login!")
    We're done now, everything is set.
    The coding part should look like this:


    You can change the design, add a menu or what ever you like.
    Even add a theme, change the username/password.

    The source will be here commented so you'll understand everything.
    This is my first tutorial, more will be comming feel free to leave tips.
    Have a nice day, i hope you learned something, for questions comment here or pm me.
    ~Thijz





    <b>Downloadable Files</b> Downloadable Files
    O F W G K T A D G A F
    https://ofwgkthijs.tumblr.com
    Proudly Kenshin13's Bitch

  2. #2
    xCyberxx's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    C:\Windows\sys32
    Posts
    1,417
    Reputation
    379
    Thanks
    1,459
    My Mood
    Devilish
    Thanks this is very helpfull! +rep!
    Quote Originally Posted by darkwrath505 View Post

    "zomg ples m4ke free hacks, im too lazy t0 get source code and update offsets." - MPGH 2015



  3. #3
    samerlol's Avatar
    Join Date
    Mar 2013
    Gender
    male
    Location
    In somewhere
    Posts
    107
    Reputation
    14
    Thanks
    3
    My Mood
    Asleep
    You can add this

    if textbox1.text("") & textbox2.text ("") then
    msgbox("Please Enter Username and Password ")
    end if

  4. #4
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    But you shouldn't.

    The 2 overloads for textbox1.Text are

    .Text()
    and
    .Text(index As Integer)

    Vb is converting "" to index 0 and checking if the char at that index is > 0.

    It won't compile if you have Option Strict On. It's not very clear code. Use textBox1.TextLenth or textbox1.Text.Length.


    @OP Thanks for inviting the ppl who needs comments like "This is a message box" to the world of user security.
    Last edited by abuckau907; 10-12-2013 at 09:14 PM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  5. #5
    linklance's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    And anyone could crack this login bro :/

  6. #6
    thijsduijker's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    368
    Reputation
    44
    Thanks
    185
    My Mood
    Doh
    Quote Originally Posted by samerlol View Post
    You can add this
    No, it'll have to be Textbox1.Text = "" And Textbox2.Text = ""
    O F W G K T A D G A F
    https://ofwgkthijs.tumblr.com
    Proudly Kenshin13's Bitch

  7. #7
    thijsduijker's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    368
    Reputation
    44
    Thanks
    185
    My Mood
    Doh
    Quote Originally Posted by linklance View Post
    And anyone could crack this login bro :/
    I never said it wouldn't be crackable.
    O F W G K T A D G A F
    https://ofwgkthijs.tumblr.com
    Proudly Kenshin13's Bitch

  8. #8
    thijsduijker's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    368
    Reputation
    44
    Thanks
    185
    My Mood
    Doh
    Quote Originally Posted by abuckau907 View Post
    But you shouldn't.

    The 2 overloads for textbox1.Text are

    .Text()
    and
    .Text(index As Integer)

    Vb is converting "" to index 0 and checking if the char at that index is > 0.

    It won't compile if you have Option Strict On. It's not very clear code. Use textBox1.TextLenth or textbox1.Text.Length.


    @OP Thanks for inviting the ppl who needs comments like "This is a message box" to the world of user security.
    Not sure if serious or..
    O F W G K T A D G A F
    https://ofwgkthijs.tumblr.com
    Proudly Kenshin13's Bitch

  9. #9
    Viewer-Bot's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    2
    Nice simple tut.


    When I`d first started making loggins, injectors I would always add progress bar, kinda got in to a bad habit.

    But on a simple loggin app, a progress bar can make it look more interesting ,and people get the impression that something is happening, even though its not. I`d also play around and add labels, as the progress bar hits certain percentages, "Working" "....Verifying Details"

    Its all practice, obv I`m just giving people starting out something else to think about.
    Last edited by Viewer-Bot; 10-21-2013 at 11:48 AM.

  10. The Following User Says Thank You to Viewer-Bot For This Useful Post:

    thijsduijker (10-22-2013)

  11. #10
    thijsduijker's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    368
    Reputation
    44
    Thanks
    185
    My Mood
    Doh
    Quote Originally Posted by Viewer-Bot View Post
    Nice simple tut.


    When I`d first started making loggins, injectors I would always add progress bar, kinda got in to a bad habit.

    But on a simple loggin app, a progress bar can make it look more interesting ,and people get the impression that something is happening, even though its not. I`d also play around and add labels, as the progress bar hits certain percentages, "Working" "....Verifying Details"

    Its all practice, obv I`m just giving people starting out something else to think about.
    Yea, but this is for the absolute noobs.
    O F W G K T A D G A F
    https://ofwgkthijs.tumblr.com
    Proudly Kenshin13's Bitch

  12. #11
    Viewer-Bot's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    2
    Yes I get that, my post was for "absolute noobs" to have something else to think about, after they made their project.

  13. #12
    Johnny9813's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    -MPGH-
    Posts
    371
    Reputation
    14
    Thanks
    266
    My Mood
    Bored
    The tutorial is very detailed and organized, contains images of procedures. good work, bro

  14. The Following User Says Thank You to Johnny9813 For This Useful Post:

    thijsduijker (10-23-2013)

  15. #13
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    File-->New Project


    Help I'm lost..I need more pictures But I really wanna make p@sswordz and th1ngz!!!


    edit: Now I can't find the Play button : (


    edit2: nvm, found it. Thank goodness for those pics.

    edit3: My password isn't "World" ...how can I make it match my actual user password?

    lol?

    :/

    In all seriousness, the first half of the tutorial is "Starting a new project and creating the GUI"
    and the second half is "Comparing a TextBox.Text to another string"

    I'm not sure if this is supposed to be a tutorial for complete beginners (in which case OP just assumes they have IDE installed? But feels the needs to show them how to create a new project.?) or a tutorial about user accounts. It fails at both, imo. Sorry if that's rude. OP I appreciate the fact that you took the time to make a tutorial, and the format was really nice, it's very easy to follow, sectioned off, etc. Thank you.
    Last edited by abuckau907; 10-22-2013 at 09:15 PM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  16. The Following User Says Thank You to abuckau907 For This Useful Post:

    thijsduijker (10-23-2013)

  17. #14
    thijsduijker's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    368
    Reputation
    44
    Thanks
    185
    My Mood
    Doh
    Quote Originally Posted by abuckau907 View Post
    File-->New Project


    Help I'm lost..I need more pictures But I really wanna make p@sswordz and th1ngz!!!


    edit: Now I can't find the Play button : (


    edit2: nvm, found it. Thank goodness for those pics.

    edit3: My password isn't "World" ...how can I make it match my actual user password?

    lol?

    :/

    In all seriousness, the first half of the tutorial is "Starting a new project and creating the GUI"
    and the second half is "Comparing a TextBox.Text to another string"

    I'm not sure if this is supposed to be a tutorial for complete beginners (in which case OP just assumes they have IDE installed? But feels the needs to show them how to create a new project.?) or a tutorial about user accounts. It fails at both, imo. Sorry if that's rude. OP I appreciate the fact that you took the time to make a tutorial, and the format was really nice, it's very easy to follow, sectioned off, etc. Thank you.
    Uh thanks i think?
    O F W G K T A D G A F
    https://ofwgkthijs.tumblr.com
    Proudly Kenshin13's Bitch

  18. #15
    TonyMane312's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    5
    Reputation
    14
    Thanks
    4
    good job, me like it!

Page 1 of 2 12 LastLast

Similar Threads

  1. [Release] Simple Login Mod.
    By awit4ever in forum CrossFire Mods & Rez Modding
    Replies: 9
    Last Post: 11-01-2011, 11:11 PM
  2. [Release] Stargate Very simple Login Image [ROBOTS]
    By difirencia in forum CrossFire Mods & Rez Modding
    Replies: 4
    Last Post: 07-12-2011, 06:17 AM
  3. [Help] SMF login application
    By S_M_E_X_Y in forum Visual Basic Programming
    Replies: 4
    Last Post: 05-05-2011, 11:47 PM
  4. [Request] Login Badge thingie on this picture
    By jorricks3 in forum CrossFire Mods & Rez Modding
    Replies: 6
    Last Post: 08-03-2010, 10:40 AM
  5. Speed Hack TuT (Easy Directions W/ Pictures)
    By TheColors in forum Combat Arms Hacks & Cheats
    Replies: 46
    Last Post: 09-23-2008, 03:19 PM

Tags for this Thread