[C#] VERY simple login system.

Timmeh Aug 3, 2013

  1. Timmeh

    Timmeh Trve Kvlt
    0/47

    Joined:
    Jan 18, 2013
    Messages:
    468
    Likes Received:
    155
    Trophy Points:
    25
    Gender:
    Male
    Occupation:
    Drummer
    Location:
    Michigan
    Console:
    Xbox
    I'm not very good at explaining things extremely well so please bare with me.​
    First step: Add two text boxes onto your form and 1 button.​
    [​IMG]
    The first text box will be for your username and the second text box will be for your password.​
    Step Two: double click on your button and add this to your codes.​
    Code:
    if (textBox1.Text == "Username" && textBox2.Text == "Password")
    {
    MessageBox.Show("Login sucessful!");
    }
    else
    {
    MessageBox.Show("Username or password incorrect!\nPlease try again!");
    }
    [​IMG]
    There you go that simple!​
    If you wish to have another form open after you login do the following.​
    Step 1: Create a second windows form.​
    Step 2:​
    Code:
    if (textBox1.Text == "Username" && textBox2.Text == "Password")
    {
    MessageBox.Show("Login sucessful!");
    Form2 f2 = new Form2();
    f2.Show();
    }
    else
    {
    MessageBox.Show("Username or password incorrect!\nPlease try again!");
    }
    [​IMG]
     
    • Like Like x 2
  2. Bu

    Bullet Guest

    Tip for next time would be put the code in a code box like this:

    Code:
    
    
    Code:
     your code goes here 
     
    • Like Like x 1
  3. Timmeh

    Timmeh Trve Kvlt
    25/47

    Joined:
    Jan 18, 2013
    Messages:
    468
    Likes Received:
    155
    Trophy Points:
    25
    Gender:
    Male
    Occupation:
    Drummer
    Location:
    Michigan
    Console:
    Xbox
    Yea I copied my post off of another site and there code, bb code is messed up, i'll edit my topic real quick ;)
     
  4. nightmarexxx

    nightmarexxx XPG Homie
    0/47

    Joined:
    Jul 8, 2012
    Messages:
    2,590
    Likes Received:
    206
    Trophy Points:
    0
    Gender:
    Male
    Location:
    Behind you! Stalk you all tha time babyyy
    Console:
    Xbox
    Nice ;)
     

Share This Page

Close