本文实例为大家分享了C++控制台实现密码管理系统的具体代码,供大家参考,具体内容如下
功能介绍:
1.怎么创建密码,输入两次
2.怎么修改密码
3.怎么删除密码
目录
1.主界面
2. 功能代码
是不是有点意思,那还不ctrl-c ctrl-v 弄入你的IDE环境下,试下
// mima.cpp: 主项目文件。 #include "stdafx.h" /// #include#include #include #include //#include using namespace std; void display(); //主界面函数 void xuanze(); //选择函数 int read_file(); //读取密码文件 void write_file();//写入密码文件 void Create_mima(); //创建密码 void YanZheng_mima(); //验证密码 void Chang_mima(); //修改密码 void delete_mima(); //删除密码 // void jiami_suanfa(char* str); //加密解密算法 char mimaStr[100]; //全局变量 //以上是函数的声明部分 //下面是函数的实现部分 void display() //主界面函数 { system("cls"); read_file(); cout<<"tt************************************************"< >mimaStr; return 1; } void write_file()//写入密码文件 { ofstream outfile("MiMa_record.txt"); if (!outfile) { cout<<"can not open the file!"< 5)break; else if(ch==13)ch=getch(); else { cout<<"*"; mimaStr[i++]=ch; ch=getch(); } } mimaStr[i]=' '; //结束标志 i=0; cout< 5)break; else if(ch=='r')ch=getch(); else { cout<<"*"; str[i++]=ch; ch=getch(); } } str[i]=' '; //结束标志 if (strcmp(mimaStr,str)==0) { jiami_suanfa(mimaStr); write_file(); cout< 5)break; else if(ch=='r')ch=getch(); else { cout<<"*"; str[i++]=ch; ch=getch(); } } str[i]=0; cout< 5)break; else if(ch=='r')ch=getch(); else { cout<<"*"; str[i++]=ch; ch=getch(); } } str[i]=' '; cout< 5)break; else if(ch=='r')ch=getch(); else { cout<<"*"; mimaStr[i++]=ch; ch=getch(); } } mimaStr[i]=' '; //结束标志 i=0; cout< 5)break; else if(ch=='r')ch=getch(); else { cout<<"*"; str[i++]=ch; ch=getch(); } } str[i]=' '; //结束标志 if (strcmp(mimaStr,str)==0) { jiami_suanfa(mimaStr); write_file(); cout< 5)break; else if(ch=='r')ch=getch(); else { cout<<"*"; str[i++]=ch; ch=getch(); } } str[i]=' '; cout<


