本文整理汇总了C++中UserList::getUser方法的典型用法代码示例。如果您正苦于以下问题:C++ UserList::getUser方法的具体用法?C++ UserList::getUser怎么用?C++ UserList::getUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserList
的用法示例。
在下文中一共展示了UserList::getUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: login
void login()
{
string user;
cout << endl;
cout << "Please enter your username, then press enter." << endl;
cout << "User Entry: ";
cin >> user;
//get user from database
User input = theDatabase.getUser(user);
//search for name
if (input.getName() == user)
{
string password;
cout << endl;
cout << "Please enter your password, then press enter." << endl;
cout << "User Entry: ";
cin >> password;
//password validation
User theUser = theDatabase.getUser(user);
if (theUser.getPassword() == password)
{
cout << endl;
cout << "Password Correct! Logging in..." << endl;
//call logged in menu
loggedinmenu(theUser);
}
else
{
cout << endl;
cout << "Username and/or Password is incorrect." << endl;
cout << "Please Try Again" << endl;
//call welcomescreen
welcomescreen();
}
}