设为首页 加入收藏

TOP

C++实现公司设备管理系统(五)
2023-07-23 13:25:21 】 浏览:139
Tags:司设备 管理系
;<endl; } if (flag) { cout <<endl <<"对不起!!!没有你找的设备!!!!" <<endl <<endl; } else { while (getline(inData, str)) { outData<<str<<endl; } outData.close(); inData.close(); ofstream out("e:\\pbook.txt", ios::out); ifstream in("e:\\temp.txt", ios::in); if (!out||!in) { cout <<endl <<"对不起,不能打开文件!!!" <<endl <<endl; system("pause"); return; } while (getline(in,str)) { out<<str<<endl; } out.close(); in.close(); cout <<endl <<"这个设备的信息已经删除!!!" <<endl <<endl; } system("pause"); } //删除管理员 void vip::dele() { ofstream outData("e:\\temp1.txt", ios::out); ifstream inData("e:\\Document.txt", ios::in); if (!inData) { cout <<endl <<"对不起!!!!找不到文件!!!!" <<endl; system("pause"); return; } string sign; cout <<endl <<"你要删除管理员的帐号 :"; cin >>sign; string str1; bool flag = true; string str; while(inData>>id) { getline(inData,str); if(sign==id) { cout <<endl <<"你想删除的管理员:" <<endl <<endl; cout<<H3<<H4<<H5; cout<<setw(10)<<id<<str<<endl; cout<<H5; flag = false; break; } outData<<setiosflags(ios::left)<<id<<setw(10)<<str<<endl; } if (flag) { cout <<endl <<"对不起!!!没有你找的管理员信息!!!!" <<endl <<endl; } else { while (getline(inData, str)) { outData<<str<<endl; } outData.close(); inData.close(); ofstream out("e:\\Document.txt", ios::out); ifstream in("e:\\temp1.txt", ios::in); if (!out||!in) { cout <<endl <<"对不起,不能打开文件!!!" <<endl <<endl; system("pause"); return; } while (getline(in,str)) { out<<str<<endl; } out.close(); in.close(); cout <<endl <<"这个管理员的信息已经删除!!!" <<endl <<endl; } system("pause"); } //显示所有信息 void machine::show() { ifstream inData("e:\\pbook.txt",ios::in); if (!inData) { cout <<endl <<"对不起!!!!没有找到文件!!!!!" <<endl; system("pause"); return; } bool flag = true; string record; while (getline(inData, record)) { if (flag) { cout <<endl <<"所有设备信息如下: "<<endl; cout<<H<<H1<<H2; } cout <<record<<endl; cout<<H2; flag = false; } if (flag) { cout <<endl <<"系统中没有设备信息!!!!!" <<endl <<endl; } else { cout <<endl <<"所有设备信息已经全部显示出来!!!!!" <<endl <<endl; } system("pause"); } void vip::show() { ifstream inData("e:\\Document.txt",ios::in); if (!inData) { cout <<endl <<"对不起!!!!没有找到文件!!!!!" <<endl; system("pause"); return; } bool flag = true; string record; while (getline(inData, record)) { if (flag) { cout <<endl <<"所有管理员信息如下: "<<endl; cout<<H3<<H4<<H5; } cout <<record<<endl; c
首页 上一页 2 3 4 5 6 7 下一页 尾页 5/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇C++子类的构造函数 下一篇C++数值计算——矩阵类的实现(一..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目