-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.cpp
96 lines (80 loc) · 1.67 KB
/
login.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
#include <iostream>
#include<windows.h>
#include<string>
#include<stdio.h>
using namespace std;
void gotoxy(int x,int y)
{
COORD c;
c.X=x;
c.Y=y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),c);
}
void login();
void menu()
{system("cls");
int x;
for(x=0;x<=10;x++)
{ Sleep(1200);
gotoxy(47,11);
printf("Loading--");
cout<<x*10<<"%";
system("COLOR f6");
gotoxy(47+x,12);
printf("..");
}
system("cls");
gotoxy(48,11);
system("COLOR f2");
printf("--Acess Granted--");
cout<<"\n \n \n \n \n \n \n \n \n \n ";
system("PAUSE");
}
void pass()
{ char pas[20];
system("cls");
gotoxy(40,12);
system("COLOR f4");
printf("Enter Your Password-->");
cin>>pas;
if(strcmp(pas,"pass")==0)
{ menu();
exit(0);
}
else
system("COLOR f4");
system("cls");
gotoxy(42,11);
printf("Wrong Password Please Login Again");
cout<<"\n \n \n \n \n \n \n \n \n \n ";
system("PAUSE");
system("cls");
login();
}
void login()
{
char us[20];
gotoxy(40,12);
system("COLOR f2");
printf("Enter Your Username-->");
cin>>us;
if(strcmpi(us,"root")==0)
{
system("cls");
pass();
}
else
system("cls");
system("COLOR f4");
gotoxy(45,12);
system("COLOR f4");
printf("Wrong Username ");
gotoxy(45,13);
Sleep(700);
login();
}
int main()
{
login();
return 0;
}