Login Form.

Discussion in 'C Programming' started by rajaroy, Feb 14, 2009.

  1. rajaroy

    rajaroy

    Joined:
    Feb 14, 2009
    Messages:
    2
    Hi there programmers,

    I am recently trying to get a form to work with a login system.
    It is a very simple form but its eating my ass off and can't get it to work.

    I have simply 2 forms.
    Form 2 and Form3.

    I want to login with a username test and password 1234.
    if the username and pass are not correct its should do nothing.
    but when username and pass correct it needs to opens Form3
    There is also no database involved here.

    username field = textbox1
    password field = textbox2

    Maybe this is the simplest script ever but i really cant get it to work.
    Over the internet there are too many complicated script's that i dont understand completely.

    Please help....

    Regards,

    Raja

    Form2:
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class Form2 : Form
        {
            public Form2()
            {
                InitializeComponent();
            }
    
            private void annuleren_Click(object sender, EventArgs e)
            {
                this.Close();
            }
    
            private void ok_Click(object sender, EventArgs e)
            {
                string waarde;
                waarde = textbox2.Text;
                int n = Int32.Parse("waarde");
                if (n == 1234)
                    textbox2.Text = "1234";
                    Form3 f3 = new Form3();
                    f3.Show();
            }
        }
    }
    
    -----------------------------------------------------------------------
    Form3:
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication1
    {
        public partial class Form3 : Form
        {
            public Form3()
            {
                InitializeComponent();
            }
    
            private void label2_Click(object sender, EventArgs e)
            {
    
            }
    
            private void sluiten_Click(object sender, EventArgs e)
            {
                this.Close();
            }
        }
    }
    
    Last edited: Feb 14, 2009
    rajaroy, Feb 14, 2009
    #1
    1. Advertising

  2. rajaroy

    rajaroy

    Joined:
    Feb 14, 2009
    Messages:
    2
    Little bump
    rajaroy, Feb 15, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William F. Robertson, Jr.
    Replies:
    0
    Views:
    428
    William F. Robertson, Jr.
    Jul 2, 2003
  2. Hermit Dave

    Forms Login Page Not Login Out

    Hermit Dave, Jan 12, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    452
    Hermit Dave
    Jan 13, 2004
  3. DavidADEW
    Replies:
    2
    Views:
    2,693
    DavidADEW
    Sep 1, 2006
  4. manu
    Replies:
    1
    Views:
    774
    Evans
    Jul 20, 2008
  5. Bruce
    Replies:
    5
    Views:
    178
    Joseph MCAD
    Apr 11, 2005
Loading...

Share This Page