3位用户的C ++登录菜单 [英] c++ login menu for 3 user

查看:51
本文介绍了3位用户的C ++登录菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些用户的项目,他们的信息已保存在ha文件中,我想创建一个项目,任何用户都可以输入他的用户名和密码,如果他的信息学家是真实的,则可以进入菜单
像这样
首次登录
请输入您的用户名:
请输入您的密码:
如果他们是真的,那么他可以进入这样的菜单
插入对象我与一些用户进行了项目共享,并且他们的信息已保存在ha文件中,我想创建一个项目,任何用户都可以输入他的用户名和密码,如果他的信息学家是真实的,则可以进入菜单
像这样
首次登录
请输入您的用户名:
请输入您的密码:
如果他们是真的,那么他可以进入这样的菜单
1)插入对象
2)删除对象
3)编辑对象
4)更改密码
在这个项目中,我必须归档一个文件供用户参考,一个归档文件供对象信息

I have a projet with some user and their information have saved in ha file i want to creat a project that any user can iput his username and password an if his informatian were true he can enter to his menu
like this
at first login
please inter your username:
please inter your password:
an then if they were true he can enter to a menu like this
inser an objectI have a projet with some user and their information have saved in ha file i want to creat a project that any user can iput his username and password an if his informatian were true he can enter to his menu
like this
at first login
please inter your username:
please inter your password:
an then if they were true he can enter to a menu like this
1)insert an object
2)delete an object
3)edit an object
4)change your password
in this project i have to files one file for users information an one file for object information

推荐答案

(请编辑您的帖子以使其更加清晰,您有重复的信息)在那儿)

所以啊 ?你到目前为止做了什么?

这是一个控制台应用程序吗?或GUI应用程序?

我认为这是一个控制台应用程序...

学习并使用std::cinstd::cout在屏幕上打印和阅读信息.

像这样的东西:

(please edit your post to make it a bit clearer, you have duplication in there)

yeah, so ? what have you done up to now ?

Is this a console application ? or a GUI application ?

I assume it''s a console application...

Learn and use std::cin, std::cout to print and read information on the screen.

Something like:

std::string username;
std::string password;
std::cout << "enter username" << std::endl;
std::getline (cin,username);
std::count << "enter password" << std::endl;
// here you should be more "intelligent" and find a way to display ***** instead of the password 
std::getline( cin, password ); 
if ( checkUserPassword ( username, password ) 
{
 // continue...
}
else
{
// exit
}


这篇关于3位用户的C ++登录菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆