Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //precompiler directives:
- #include <iostream>
- #include <iomanip>
- #include <fstream>
- #include <cmath>
- #include <math.h>
- #include <windows.h>
- #include <stdio.h>
- #include <string>
- using namespace std;
- // protos
- bool login();
- bool usnlogin();
- bool pwlogin();
- int main() {
- system("color 04");
- login();
- }
- bool login(){
- string usn,pw;
- string properusername = "Crypto";
- system("TITLE Crypto's Login Screen v1.0.0 [ALPHA]");
- //bool sucess1,sucess2 = false;
- cout<<"Hello and welcome to this application"<<endl<<endl<<"In order to use this program please enter your username and password"<<endl;
- //usnlogin();
- if(usnlogin() == true){
- //pwlogin();
- }
- else if(usnlogin() == false){
- cout<< "An error has occured"<<endl;
- exit(-1337);
- }
- if(pwlogin() == true){
- /////////////////////////////////////
- ///////////////ENTER THE PROGRAM CALL HERE/////////////
- ////////////////////////////////////
- cout<<"works"<<endl;
- Sleep(1000);
- exit(1);
- }
- else if(pwlogin() == false){
- cout<<"An error has occured"<<endl;
- exit(-1338);
- }
- }
- bool usnlogin(){
- string properusername = "Crypto";
- string usn;
- // input of username
- cout<<"usn: ";
- cin>> usn;
- //error of username
- if(usn != properusername){
- cout<<"An error has occured. Either that USN is not registered to this build or it is spelled wrong"<<endl;
- cout<<"Please try again later or check for spelling mistakes"<<endl;
- return false;
- }
- //success.
- else if(usn == properusername){
- cout<<"...";
- system("color 3C");
- Sleep(1000);
- system("color 04");
- cout<<"Correct!"<<endl;
- return true;
- }
- }
- bool pwlogin(){
- //deffiners
- string properpassword = "crypt";
- string pw;
- // inputs password
- cout<<"pw: ";
- cin>>pw;
- if(pw != properpassword){
- cout<<"An error has occured. Either that PW is not registered to this build or it is spelled wrong"<<endl;
- cout<<"Please try again later or check for spelling mistakes"<<endl;
- return false;
- }
- else if(pw == properpassword){
- cout<<"...";
- system("color 3C");
- Sleep(1000);
- system("color 03");
- cout<<"Correct!"<<endl;
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement