-
Notifications
You must be signed in to change notification settings - Fork 2
/
BaitapC#.TH05
119 lines (101 loc) · 3.41 KB
/
BaitapC#.TH05
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "1";
}
private void button2_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "2";
}
private void button3_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "3";
}
private void button4_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "0";
}
private void button5_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "4";
}
private void button6_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "5";
}
private void button7_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "6";
}
private void button9_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "7";
}
private void button10_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "8";
}
private void button11_Click(object sender, EventArgs e)
{
MatKhau.Text = MatKhau.Text + "9";
}
private void btnClear_Click(object sender, EventArgs e)
{
MatKhau.Text = "";
}
private void btnOK_Click(object sender, EventArgs e)
{
if (MatKhau.TextLength < 5)
{
int matkhau = int.Parse(MatKhau.Text);
if (matkhau == 1980 || matkhau == 1982)
{
DateTime t = DateTime.Now;
NhatKy.Text += t.ToShortDateString() + " " + t.ToLongTimeString() + " Kỹ thuật \n";
}
else if (matkhau > 2008 && matkhau <= 2010)
{
DateTime t = DateTime.Now;
NhatKy.Text += t.ToShortDateString() + " " + t.ToLongTimeString() + " Quản lý \n";
}
else if (matkhau == 9998 || (matkhau >= 1006 && matkhau <= 1008))
{
DateTime t = DateTime.Now;
NhatKy.Text += t.ToShortDateString() + " " + t.ToLongTimeString() + " Khoa học \n";
}
else if (matkhau >= 0 && matkhau <= 9)
{
DateTime t = DateTime.Now;
NhatKy.Text += t.ToShortDateString() + " " + t.ToLongTimeString() + " Restricted Access \n";
}
else
{
DateTime t = DateTime.Now;
NhatKy.Text += t.ToShortDateString() + " " + t.ToLongTimeString() + " Access denied \n";
}
}
else
{
DateTime t = DateTime.Now;
NhatKy.Text += t.ToShortDateString() + " " + t.ToLongTimeString() + " Access denied\n";
}
MatKhau.Text = "";
}
}
}