Login Form.

Joined
Feb 14, 2009
Messages
2
Reaction score
0
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:

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top