Guest User

Learning Project #1: Login System

a guest
Nov 14th, 2012
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <iostream>
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.  
  12.     string s_userName = "demo";
  13.     string s_userPass = "demo";
  14.     string s_tempName, s_tempPass;
  15.  
  16.     cout << "Test Project #2: Login" << endl;
  17.  
  18.     cout << "Enter Username: ";
  19.     cin >> s_tempName;
  20.  
  21.     cout << "Enter Password: ";
  22.     cin >> s_tempPass;
  23.  
  24.     if( s_userName == s_tempName && s_userPass == s_tempPass )
  25.     {
  26.         cout << "Successfully Logged In!" << endl;
  27.     }
  28.     else
  29.     {
  30.         cout << "Invalid Username/Password!" << endl;
  31.     }
  32.  
  33.     // Bad form, but sue me.
  34.     system("PAUSE");
  35.  
  36.     return 1;
  37. }
Add Comment
Please, Sign In to add comment