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 WindowsFormsApplication13
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int ctr;
private void button1_Click(object sender, EventArgs e)
{
ctr = ctr + 1;
if ((textBox1.Text == "arvind") && (textBox2.Text == "arvind"))
{
label1.Visible = true ;
label1.Text = "Welcome to Arvind Commmunication";
ctr = 0;
}
else
{
if (ctr<3)
{
label1.Visible = true;
label1.Text = "Incorrect user name or password try again..";
textBox1.Focus();
}
else
{
MessageBox.Show("Unauthorized Access.");
Close();
}
textBox1.Text = "";
textBox2.Text = "";
}
}
}
}