[Tutorial] Really, really simple login system.

XPGProgrammer Feb 25, 2013

  1. XPGProgrammer

    XPGProgrammer Newbie
    205/282

    Joined:
    Jan 2, 2013
    Messages:
    802
    Likes Received:
    214
    Trophy Points:
    0
    Gender:
    Male
    Location:
    Canada
    Console:
    Xbox
    Hello guys, I decided to make a simple tutorial about how to make a login system. You must remember that since it's simple, it will be easy to crack. I personaly suggest you guys to use a database to store the information but you can still use this method (if you're too lazy).

    Step 1:
    Open Visual Studio and select the language "C#" and select "Windows Form Application".

    Step 2:
    Add a "Form2" to it by clicking "Project" at the top.

    Step 3:
    Go on the Form2 and make it looks like that:

    Step 4:
    When all the buttons and textboxes are there, click on the button.

    Step 5:
    Add the following code to the button.


    string username1 = "Programmer"; //You need to write these in the txtboxes.
    string password1 = "lollipop123";

    if (this.textBox1.Text == username1 && this.textBox2.Text == password1)
    {
    MessageBox.Show("Welcome " + textBox1.Text + "!");
    new Form1().Show();
    this.Visible = false;
    }
    else
    {
    MessageBox.Show("Incorrect username or password");
    }



    Step 6:
    It's now done, simple but it works!

    FAQS:
    Q: Why can I see the characters when I'm typing my password?
    A: There's a setting into the properties, you must put it to true:
    [​IMG]
     
  2. gold972

    gold972 团队XPG影响 Effect XPG Developer TeamXPG
    205/282

    Joined:
    Dec 6, 2010
    Messages:
    6,833
    Likes Received:
    14,866
    Trophy Points:
    205
    Gender:
    Male
    Location:
    France Kernal XDK
    Console:
    Xbox
    nice work mate ,)
     

Share This Page

Close