;<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 |