Advertisement
coderwander

Untitled

Dec 19th, 2018
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.52 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Manevra
  12. {
  13.     public partial class Login : Form
  14.     {
  15.         private int contor;
  16.         private string username = "Narita";
  17.         private string pass = "Narita";
  18.         public Login()
  19.         {
  20.             InitializeComponent();
  21.         }
  22.  
  23.         private void button1_Click(object sender, EventArgs e)
  24.         {
  25.             if (textBox1.Text.Equals(username))
  26.                 if (textBox2.Text.Equals(pass))
  27.                 {
  28.                     timer1.Enabled = true;
  29.                     contor = 0;
  30.                     timer1.Start();
  31.                 }
  32.                 else
  33.                 {
  34.                     MessageBox.Show("Date eronate!");
  35.                 }
  36.             else
  37.             {
  38.                 MessageBox.Show("Date eronate!");
  39.             }
  40.                    
  41.         }
  42.  
  43.         private void timer1_Tick(object sender, EventArgs e)
  44.         {
  45.             contor++;
  46.             progressBar1.Value = contor;
  47.             if(progressBar1.Value == 20)
  48.             {
  49.                 timer1.Stop();
  50.                 timer1.Enabled = false;
  51.                 this.DialogResult = DialogResult.OK;
  52.                 Close();
  53.             }
  54.         }
  55.  
  56.         private void button2_Click(object sender, EventArgs e)
  57.         {
  58.             Close();
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement