房屋中介管理系统简易源代码.pdf

. . //(1) 登录管理模块 : 主要实现登录身份的管理 、密码管理 #include iostream #include fstream #include string #include iomanip using namespace std; class Logo { private: string name; string password; public: int in(); // 接受用户登录请求 ,决定是否允许登入 void reg(); // 用户注册 void print(); // 用户登录界面提示 }; int Logo::in() { string n,p; int i=0,j=0; //j 值表示是否存在此用户 cout 输入姓名 endl; Word 格式 . . cinn; cout 输入密码 endl; cinp; ifstream input; input.open (logoinfo.txt); while(!input.eof ()) { inputnamepassword; if(name==np==password) { i=1; } if(n==name) j=1; } input.close (); if(j==0) cout 用户不存在 ,请先注册 !endl; return i; //i 值为 1 表示登录成功 ;为 0 时表示登录失败 } void Logo::reg () // Word 格式 . . { ofstream output; output.open (logoinfo.txt,ios::out|ios::app); cout 输入你的姓名 :endl; cinname; cout 输入密码 (有效位数 8-16)endl; cinpassword; while(password.size ()8||password.size ()16) { cout 密码无效 ,请重新输入 endl; cinpassword; } outputname passwordendl; output.close (); cout 注册成功 endl; } void Logo::print () { coutsetw(40) 欢迎使用房屋中介管理系统 endl; cout 请选择操作 :endl; cout\t\t\t1 、 用户登录 endl; cout\t\t\t2 、 用户注册 endl; Word 格式

文档评论(0)

1亿VIP精品文档

相关文档