Advertisement
Guest User

Untitled

a guest
Jan 11th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.13 KB | None | 0 0
  1. #include "logowanie.h"
  2. #include <iostream>
  3. #include <fstream>
  4. #include <string>
  5. using namespace std;
  6.  
  7.  
  8.  
  9.  
  10.  
  11. logowanie::logowanie(void)
  12. {
  13. }
  14.  
  15.  
  16. logowanie::~logowanie(void)
  17. {
  18. }
  19.  
  20.  
  21. bool logowanie::zaloguj()
  22. {
  23.         ////// LOGOWANIE //////
  24.     bool done;
  25.    
  26.    
  27.     ifstream fileCheck;
  28.     int i=2;
  29.  
  30.    
  31.        
  32.     fileCheck.open(pin); //Sprawdzanie czy plik istnieje oraz bล‚edne podawanie pinu
  33.     done = true;
  34.    
  35.     while  (!fileCheck)
  36.     {
  37.         if(i!=0)
  38.         {
  39.             cout << "Podales bledny pin" << endl;
  40.             cout <<"Pozostalo prob: "<< i << endl << endl;
  41.             fileCheck.close();
  42.             cout << "Podaj pin: ";
  43.             cin >> pin;
  44.             pin = pin + ".txt";
  45.             fileCheck.open(pin);
  46.             i--;
  47.            
  48.         }
  49.         if(i == 0)
  50.         {
  51.            
  52.             done=false;
  53.             break;
  54.         }
  55.     }        
  56.     fileCheck.close();
  57.     return done;
  58. }
  59.  
  60.  
  61. int logowanie::wybor()
  62. {
  63.     int wybor;
  64.     cout << "Co chcesz zrobic?" << endl;
  65.     cout << "[1] Zaloguj sie" << endl;
  66.     cout << "[1] Zaloz konto" << endl;
  67.     cout << "[0] Wyjdz" << endl;
  68.     cin >> wybor;
  69.    
  70.     return wybor;
  71. }
  72.  
  73.  
  74. string logowanie::podawaniePIN()
  75. {
  76.  
  77.     cout << "Podaj pin: ";
  78.     cin >> pin;
  79.     pin = pin + ".txt";
  80.     cout << pin << endl;
  81.     return pin;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement