-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_authentication_menu.cpp
164 lines (159 loc) · 3.25 KB
/
user_authentication_menu.cpp
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
#include<math.h>
#include<windows.h>
char get_pass_word(void);
void draw(void);
int moving_prosses(void);
void stick_info(char*,int*);
void textcolor(unsigned short );
char ch;
char username[20];
int key_press;
int show;
int main()
{
int j1=0,i,j;
for(i=0;i<20;i++);
username[i]=' ';
i=0;
while(j1<20)
{
printf("\n\n");
for(i=0;i<30;i++)
printf(" ");
printf(" _____________________\n");
for(i=0;i<30;i++)
printf(" ");
printf("|");
for(i=0;i<21;i++)
printf(" ");
printf("|\n");
for(i=0;i<20;i++)
printf(" ");
printf("User name |");
stick_info(username,&j1);
printf("%s|\n",username);
for(i=0;i<30;i++)
printf(" ");
printf("|_____________________|\n");
for(i=0;i<30;i++)
printf(" ");
printf(" _____________________\n");
for(i=0;i<30;i++)
printf(" ");
printf("|");
for(i=0;i<21;i++)
printf(" ");
printf("|\n");
for(i=0;i<20;i++)
printf(" ");
printf("passeword |");
for(i=0;i<21;i++)
printf(" ");
printf("|\n");
for(i=0;i<30;i++)
printf(" ");
printf("|_____________________|");
system("cls");
}
system("cls");
j1=0;
char set_user[20];
while(j1<20)
{
for(i=0;i<30;i++)
printf(" ");
printf("______________________\n");
for(i=0;i<19;i++)
printf(" ");
printf("User name |");
printf(" |\n");
for(i=0;i<30;i++)
printf(" ");
printf("______________________\n");
strcpy(set_user,username);
for(i=0;i<30;i++)
printf(" ");
printf("______________________\n");
for(i=0;i<20;i++)
printf(" ");
printf("passeword |");
stick_info(username,&j1);
printf("%s|\n",username);
for(i=0;i<30;i++)
printf(" ");
printf("______________________\n");
system("cls");
}
while(1)
{
printf(" _____________________________________________________________________________\n");
printf("| | | | |\n");
printf("|");
if(key_press==1)
textcolor(1);
printf(" Profile ");
textcolor(15);
printf(" | ");
if(key_press==2)
textcolor(1);
printf(" Message ");
textcolor(15);
printf(" | ");
if(key_press==3)
textcolor(1);
printf(" music ");
textcolor(15);
printf(" | ");
if(key_press==4)
textcolor(1);
printf(" Logout ");
textcolor(15);
printf(" |\n");
printf("|__________________|____________________|__________________|__________________|\n");
printf("\nRIGHT : d\nLEFT : a\nUP : w\nDOWN : s\nAPPLY : 1\n");
while(1)
{
if(kbhit())
{
ch = getch();
break;
}
}
if(ch=='d'&&key_press<5)
key_press++;
else
if(ch=='a'&&key_press>1)
key_press--;
else
if(ch=='1')
{
show=key_press;
break;
}
system("cls");
}
return(0);
}
void stick_info(char*tab,int*j1)
{
ch=' ';
while(1)
{
if(kbhit())
{
ch = getch();
tab[*j1]=ch;
j1++;
break;
}
}
}
void textcolor(unsigned short color)
{
HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hcon,color);
}