南航通讯录管理系统——面向对象程序设计C++课设报告

四、编码

//PASSWORD:密码登陆 //Password.h文件的内容: #include \

#ifndef PASSWORD_H #define PASSWORD_H

int enter(); //登录页面 int check(); //核对密码 void login(); //注册 #endif

//文件Password.cpp的内容: #include #include #include \#include #include #include #include #include #include using namespace std; string user; //用户名 string code; //密码 string code1; //注册密码

int check() { ifstream infile(\ if(!infile) { cout<>sign; fflush(stdin);

9

cout <>sign1;

fflush(stdin); //清除缓存 int flag=1; string str; while(infile>>user>>code) //读出数据 { getline(infile,str); if((user==sign)&&(code==sign1)) //检查用户名,密码是否正确 { cout<

cout<

void login() //用户注册 { system(\ //清屏 cout<<\ 请输入管理员注册权限密码:\ string str; str=\ string str1; cin>>str1; if(str1==str) { cout<<\ 通过认证!!!\ cout<<\ 请创建新的用户名:\ cin>>user; fflush(stdin); cout<<\ 请输入密码:\ cin>>code; fflush(stdin);

10

>>灞曞紑鍏ㄦ枃<<
12@gma联系客服:779662525#qq.com(#替换为@)