Rabu, 10 Juli 2013

Address Book Project in c#

Introduction:
Address book stores information of your family member or other person. This project contain some forms such as login form .
login form


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AddressBook
{
    public partial class LoginForm : Form
    {
        Thread appThread;
        public LoginForm()
        {
            InitializeComponent();
        }
        private void loginButton_Click(object sender, EventArgs e)
        {
            if (unameTextBox.Text == "admin" && passwordTextBox.Text == "password")
            {
                this.Close();
                appThread = new Thread(LaunchAdminApplication);
                appThread.SetApartmentState(ApartmentState.STA);
                appThread.Start();
            }
            else
                MessageBox.Show("Invalid Credentials", "Login Error!");
        }
        private void LaunchAdminApplication()
        {
            Application.Run(new MainForm());
        }
    }
}
Here  "unameTextBox" is the name property of the username textbox and "passwordTextBox" is the property of Password text box . if username and password are right then you can enter into new thread. A message box generated if your  username and password are wrong .

manage form




Your project will submit after 5 hour 

Tidak ada komentar:

Posting Komentar