Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "logowanie.h"
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- logowanie::logowanie(void)
- {
- }
- logowanie::~logowanie(void)
- {
- }
- bool logowanie::zaloguj()
- {
- ////// LOGOWANIE //////
- bool done;
- ifstream fileCheck;
- int i=2;
- fileCheck.open(pin); //Sprawdzanie czy plik istnieje oraz bลedne podawanie pinu
- done = true;
- while (!fileCheck)
- {
- if(i!=0)
- {
- cout << "Podales bledny pin" << endl;
- cout <<"Pozostalo prob: "<< i << endl << endl;
- fileCheck.close();
- cout << "Podaj pin: ";
- cin >> pin;
- pin = pin + ".txt";
- fileCheck.open(pin);
- i--;
- }
- if(i == 0)
- {
- done=false;
- break;
- }
- }
- fileCheck.close();
- return done;
- }
- int logowanie::wybor()
- {
- int wybor;
- cout << "Co chcesz zrobic?" << endl;
- cout << "[1] Zaloguj sie" << endl;
- cout << "[1] Zaloz konto" << endl;
- cout << "[0] Wyjdz" << endl;
- cin >> wybor;
- return wybor;
- }
- string logowanie::podawaniePIN()
- {
- cout << "Podaj pin: ";
- cin >> pin;
- pin = pin + ".txt";
- cout << pin << endl;
- return pin;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement