Advertisement
Guest User

Untitled

a guest
Sep 1st, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <Windows.h>
  4. using namespace std;
  5.  
  6.  
  7.  
  8. class UserBase{
  9. public:
  10. void GetUsername(string GetName){
  11. MyUserName = GetName;
  12.  
  13.  
  14. }
  15. void GetPassword(string GetPassword){
  16. GetPassword = MyPassword;
  17.  
  18.  
  19. }
  20.  
  21. private:
  22. string MyUserName;
  23. string MyPassword;
  24.  
  25. };
  26.  
  27.  
  28.  
  29. int main(){
  30. UserBase Input;
  31. string MyName;
  32. string MyPassword;
  33. Input.GetUsername("test");
  34. Input.GetPassword("noob");
  35. cout << "enter your username, please." << endl;
  36. cin >> MyName;
  37. if (MyName == Input.GetUsername){
  38. cout << "enter your password.." << endl;
  39. cin >> MyPassword;
  40. if (MyPassword == Input.GetPassword){
  41. cout << "login was successfull" << endl;
  42. Sleep(5000);
  43. }
  44.  
  45. }
  46.  
  47.  
  48. return 0; // if 0 then its a success
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement