.NET Advanced Login C#

Discussion in 'Source Code & Tutorial Database' started by Neokilla, Apr 1, 2014 with 9 replies and 2,222 views.

  1. Neokilla

    Neokilla Life is what you make it.

    Messages:
    3,023
    Ratings:
    1,268
    Today i will be teaching you how to make an advanced login in C#.

    Requirements:
    - Visual Basic
    - Basic Knowledge

    Step 1:
    Goto https://sites.google.com and make a site this will be used to store your logins once there create a sub page below home and call it what you want.

    Step 2:
    Build a new form in vb, then go to project and add a new form so know you have two forms.

    Step 3:
    On form1 add two text boxes, a button and two labels, Name one label username and the other password, This will be your login. Now go to your password text box properties and change password character to * like this http://gyazo.com/9e18b4e25d71ba0c299558b798f1739f


    Step 4:
    Now double click your login button and add this code,
    string userinfo = new System.Net.WebClient().DownloadString("https://sites.google.com/site/logintut/home/logins");
    if (textBox1.Text != "" && textBox2.Text != "")
    {
    if (userinfo.Contains(textBox1.Text + " | " + textBox2.Text))
    {
    Hide();
    Form2 Main = new Form2();
    Main.Show();
    }
    else
    {
    MessageBox.Show("Login Failed, Please Try Again");
    }
    }
    You will replace the website url i have with the one i told you to create earlier.

    Step 5:
    Now go to your website url which i told you to add earlier and add some text for example
    username | password, replace username and password with what you want and now when you click login on your tool it will search the website for text you entered in the login and if it matches what's on the login it will take you to form2 which could be anything you want a XRPC tool for example else it will show an error.

    This is a great way of making a login because you can have as many people as you want added, by just adding a new line on the site with the new login.
    Your finished tool should look something like this
    http://gyazo.com/63f3df9fbf308e8348160999bf7e4729
    and the website like this http://gyazo.com/7ff471b804fb584a100e3866d82ed1d5


    Leave a like if you found this tutorial helpful.
     
    • Like Like x 5
    Last edited: Apr 4, 2014
  2. MatthewH

    MatthewH Member

    Messages:
    1,612
    Ratings:
    615
    I wouldn't consider this an "advanced" login. A basic login maybe.
     
    • Like Like x 2
  3. OP
    Neokilla

    Neokilla Life is what you make it.

    Messages:
    3,023
    Ratings:
    1,268
    Basic would be more like this,
    if (textBox1.Text = "test" & textBox2.Text = "Login")
    {
    Messagebox.Show("Login Successful");
    }
    else
    {
    MessageBox.Show("Login Failed, Please Try Again");
    }
     
  4. MatthewH

    MatthewH Member

    Messages:
    1,612
    Ratings:
    615
    No, I don't even consider that logging in. That's not the same. This is still basic.

    Here's a good example of a more advanced login, which I'm not seeing. I don't feel like writing the code out at this time because I'm right in the middle of something. But overall let's assume you're wanting to log into uhhh www.login.com. They have a very simple log in ability directly on login.php. Here's the log in for example.
    www.login.com/login.php?u=username&p=password
    That's not how it would go, in a simplified way.

    So you take your two textboxes (usertext and passtext) and I would personally store them.
    User = usertext.Text;
    Pass = passtext.Text;

    Then post them...
    ("http://www.login.com/login.php?u=" + User + "&p=" + Pass)

    That's more or less an "advanced" log in.
    Good job nonetheless.
     
  5. Sketch

    Sketch Enthusiast

    Messages:
    696
    Ratings:
    316
    That's what people should be using. Or download the variables securely (Using the webclient) and then sending them back.
    Connect to backend
    Download the data
    Respond with data entered by user
    // do some more

    I could write up something later but it depends.
     
  6. VenomIzPro

    VenomIzPro Enthusiast

    Messages:
    81
    Ratings:
    3
    I would like to use this :tongue: I just don't know how to use sites.google.com.

    Could you help me out a little bit?
     
  7. MatthewH

    MatthewH Member

    Messages:
    1,612
    Ratings:
    615
    It's honestly not well laid out. It's also very hard to understand if you're new. No offense to OP.
    What are you trying to do?
     
  8. OP
    Neokilla

    Neokilla Life is what you make it.

    Messages:
    3,023
    Ratings:
    1,268
    Sure what do you need help with.
     
  9. VenomIzPro

    VenomIzPro Enthusiast

    Messages:
    81
    Ratings:
    3
    I don't really know how to use sites.google.com

    Never used it before. I always used Databases for login/register but I don't have a site anymore.
     
  10. Z61

    Z61 Some times our saints are sinners Retired

    Messages:
    5,520
    Ratings:
    3,061
    Please attempt to format the post better, it's quite hard on the eyes.
     
    • Like Like x 1

Share This Page