Exemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     button1.Enabled = true;
     button1.Visible = true;
     GREEN.Clear();
     button2.Visible     = false;
     pictureBox1.Enabled = false;
     g.FillRectangle(new SolidBrush(Color.SlateGray), 0, 0, 400, 400);
     off();
 }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (button1.Text == "Войти")
     {
         textBox3.Enabled = false;
         a                   = Convert.ToInt32(textBox3.Text);
         a_k                 = 400 / a;
         button1.Text        = "OK";
         pictureBox1.Enabled = true;
         GenerateALF();
         zapusk();
         DrawGRID();
         textBox2.Enabled = true;
     }
     else
     {
         if (button1.Text == "OK")
         {
             button1.Text     = "Войти";
             textBox2.Enabled = false;
             if (Check(textBox1.Text) == Convert.ToInt32(textBox2.Text))//пароль верен
             {
                 button1.Visible = false;
                 g.FillRectangle(GainBrush, 0, 0, 400, 400);
                 g.DrawString("ДОСТУП", BigFont, BlackBrush, new Point(50, 100), drawFormat);
                 g.DrawString("РАЗРЕШЕН", BigFont, BlackBrush, new Point(15, 200), drawFormat);
                 Thread.Sleep(600);
                 g.FillRectangle(GainBrush, 0, 0, 400, 400);
                 button2.Visible = true;
                 Pxy.Clear();
             }
             else
             {
                 g.FillRectangle(GainBrush, 0, 0, 400, 400);
                 button1.Visible = true;
                 GREEN.Clear();
                 pictureBox1.Enabled = false;
                 textBox3.Enabled    = true;
                 g.DrawString("ОШИБКА", BigFont, BlackBrush, new Point(50, 150), drawFormat);
                 Thread.Sleep(700);
                 g.FillRectangle(new SolidBrush(Color.SlateGray), 0, 0, 400, 400);
             }
             textBox2.Text = "0";
         }
     }
 }