|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
//<2F><><EFBFBD>庯<EFBFBD><E5BAAF>
|
|
|
|
|
FILE *fp; //<2F>ļ<EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
void menu();
|
|
|
|
|
void add();
|
|
|
|
|
void search();
|
|
|
|
|
void modify();
|
|
|
|
|
void dele();
|
|
|
|
|
void look();
|
|
|
|
|
void quit();
|
|
|
|
|
void enroll();
|
|
|
|
|
void login();
|
|
|
|
|
void reenroll();
|
|
|
|
|
void jiemian();
|
|
|
|
|
void ycmm();
|
|
|
|
|
void relogin();
|
|
|
|
|
|
|
|
|
|
int n;
|
|
|
|
|
int m;
|
|
|
|
|
int t;
|
|
|
|
|
int offset;
|
|
|
|
|
char mima_[10];
|
|
|
|
|
char MIMA[4]="5555";
|
|
|
|
|
|
|
|
|
|
struct manager
|
|
|
|
|
{
|
|
|
|
|
char name[10];
|
|
|
|
|
char password[10];
|
|
|
|
|
}manage[5];
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
int a=0;
|
|
|
|
|
n=0;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
jiemian();
|
|
|
|
|
getchar();
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>");
|
|
|
|
|
a=getch();
|
|
|
|
|
}while(a==49);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
//ͨѶ¼<D1B6>ṹ<EFBFBD><E1B9B9>
|
|
|
|
|
struct user
|
|
|
|
|
{
|
|
|
|
|
char name[8]; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
char place[15]; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
char tel1[15]; //<2F>绰1
|
|
|
|
|
char tel2[15]; //<2F>绰2
|
|
|
|
|
char email[20]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
}user[50];
|
|
|
|
|
|
|
|
|
|
void jiemian()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color f3");
|
|
|
|
|
int n;
|
|
|
|
|
printf("\n\n\n\n\n");
|
|
|
|
|
printf("\t\t:---------ͨѶ¼---------:\n");
|
|
|
|
|
printf("\t\t: 1.ע<><D7A2> :\n");
|
|
|
|
|
printf("\t\t: 2.<2E><>¼ :\n");
|
|
|
|
|
printf("\t\t:--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <1-2>ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--:\n\n");
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
switch(n)
|
|
|
|
|
{
|
|
|
|
|
case 1: enroll(); break; //ע<><D7A2>
|
|
|
|
|
case 2: login(); break; //<2F><>¼
|
|
|
|
|
default: return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//ע<><D7A2>
|
|
|
|
|
void enroll()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
int anhao; //<2F><><EFBFBD><EFBFBD>Ա<EFBFBD>ܳ<EFBFBD>
|
|
|
|
|
char zhanghao[10];
|
|
|
|
|
char mima1[10];
|
|
|
|
|
char mima2[10];
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Աע<D4B1><D7A2>
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>밵<EFBFBD>ţ<EFBFBD>");
|
|
|
|
|
ycmm();
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>ź˶<C5BA><CBB6><EFBFBD>ȷ
|
|
|
|
|
if(!strcmp(mima_,MIMA)){
|
|
|
|
|
fp=fopen("manager.txt","ab");
|
|
|
|
|
struct manager one;
|
|
|
|
|
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¹<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>˺ţ<EFBFBD>");
|
|
|
|
|
scanf("%s",zhanghao);
|
|
|
|
|
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¹<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
ycmm();
|
|
|
|
|
strcpy(mima1,mima_);
|
|
|
|
|
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD>ٴ<EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
ycmm();
|
|
|
|
|
strcpy(mima2,mima_);
|
|
|
|
|
if(!strcmp(mima1,mima2)){
|
|
|
|
|
strcpy(one.name,zhanghao);
|
|
|
|
|
strcpy(one.password,mima1);
|
|
|
|
|
fprintf(fp,"%-10s%-10s",one.name,one.password);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
fclose(fp);reenroll();return;
|
|
|
|
|
}
|
|
|
|
|
printf("\t\t\tע<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n\n");
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
menu();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٴ<EFBFBD>ע<EFBFBD><D7A2>
|
|
|
|
|
else
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>\n\n");reenroll();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
|
|
|
|
|
void reenroll()
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>밴1<EFBFBD><EFBFBD>");
|
|
|
|
|
if(getch()==49)
|
|
|
|
|
enroll();
|
|
|
|
|
else
|
|
|
|
|
jiemian();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><>¼
|
|
|
|
|
void login()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
char zhanghao[20];
|
|
|
|
|
char mima[20];
|
|
|
|
|
char password2[20];
|
|
|
|
|
if((fp=fopen("manager.txt","rb"))==NULL){
|
|
|
|
|
printf("δ<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>˺<EFBFBD>\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ᣬ3<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
enroll();
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
struct manager one;
|
|
|
|
|
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD>˺ţ<EFBFBD>");
|
|
|
|
|
scanf("%s",zhanghao);
|
|
|
|
|
printf("\n\t\t\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>룺");
|
|
|
|
|
ycmm();
|
|
|
|
|
while(!feof(fp)){
|
|
|
|
|
fscanf(fp,"%s%s",one.name,one.password);
|
|
|
|
|
if(!strcmp(zhanghao,one.name)&&!strcmp(mima_,one.password)){
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD>¼<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
n=1;
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
Sleep(3000);
|
|
|
|
|
menu();return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("\t\t\t<EFBFBD><EFBFBD>¼ʧ<EFBFBD>ܣ<EFBFBD>\n\n");
|
|
|
|
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
relogin();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
|
|
|
|
|
void relogin()
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>밴1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棺");
|
|
|
|
|
if(getch()==49)
|
|
|
|
|
login();
|
|
|
|
|
else
|
|
|
|
|
jiemian();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void ycmm()
|
|
|
|
|
{
|
|
|
|
|
int i=0;
|
|
|
|
|
for(;i<10;i++)
|
|
|
|
|
{
|
|
|
|
|
mima_[i]=getch();
|
|
|
|
|
if(mima_[i]=='\b')
|
|
|
|
|
{
|
|
|
|
|
if(i<=0)
|
|
|
|
|
printf(" "),i=1;
|
|
|
|
|
printf("\b \b");
|
|
|
|
|
i=i-2;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if(mima_[i]=='\r')
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
printf("*");
|
|
|
|
|
}
|
|
|
|
|
mima_[i]='\0';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F>˵<EFBFBD>
|
|
|
|
|
void menu()
|
|
|
|
|
{
|
|
|
|
|
int b=0;
|
|
|
|
|
do{
|
|
|
|
|
system("cls");
|
|
|
|
|
system("color f3");
|
|
|
|
|
int a;
|
|
|
|
|
b=0;
|
|
|
|
|
printf("\n\n\n\n\n");
|
|
|
|
|
printf("\t\t:----ͨѶ¼<D1B6><C2BC><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>----:\n");
|
|
|
|
|
printf("\t\t: 1:<3A>½<EFBFBD> :\n");
|
|
|
|
|
printf("\t\t: 2:<3A><>ѯ :\n");
|
|
|
|
|
printf("\t\t: 3:<3A><EFBFBD> :\n");
|
|
|
|
|
printf("\t\t: 4:ɾ<><C9BE> :\n");
|
|
|
|
|
printf("\t\t: 5:<3A><><EFBFBD><EFBFBD> :\n");
|
|
|
|
|
printf("\t\t: 6:<3A><><EFBFBD><EFBFBD> :\n");
|
|
|
|
|
printf("\t\t: 7:<3A>˳<EFBFBD> :\n");
|
|
|
|
|
printf("\t\t:--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <1-7>ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--:\n\n");
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
switch(a)
|
|
|
|
|
{
|
|
|
|
|
case 1: add(); break; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
case 2: search(); break; //<2F><>ѯ
|
|
|
|
|
case 3: modify(); break; //<2F><EFBFBD>
|
|
|
|
|
case 4: dele(); break; //ɾ<><C9BE>
|
|
|
|
|
case 5: look(); break; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
case 6: jiemian(); break; //<2F>˳<EFBFBD>
|
|
|
|
|
case 7: exit(0);
|
|
|
|
|
default: return;
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>棺");
|
|
|
|
|
b=getch();
|
|
|
|
|
}while(b==49);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>Ϣ 1.<2E>½<EFBFBD>
|
|
|
|
|
void add()
|
|
|
|
|
{
|
|
|
|
|
struct user one={'\0','\0','\0','\0','\0'};//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
system("color e3");
|
|
|
|
|
if((fp=fopen("user.txt","ab"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",one.name);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",one.place);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD>绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",one.tel1);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD>绰<EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",one.tel2);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺");
|
|
|
|
|
scanf("%s",one.email);
|
|
|
|
|
fprintf(fp,"%-8s%-15s%-15s%-15s%-20s\n",one.name,one.place,one.tel1,one.tel2,one.email);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD>ӳɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
}
|
|
|
|
|
//<2F><>ѯ 2.<2E><>ѯ
|
|
|
|
|
void search()
|
|
|
|
|
{
|
|
|
|
|
struct user one;
|
|
|
|
|
char namekey[8];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
scanf("%s",namekey);
|
|
|
|
|
if((fp=fopen("user.txt","rb"))==NULL) //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
printf("\n<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
t=0;
|
|
|
|
|
m=0;
|
|
|
|
|
while(!feof(fp))
|
|
|
|
|
{
|
|
|
|
|
offset=ftell(fp);
|
|
|
|
|
fscanf(fp,"%s%s%s%s%s\n",one.name,one.place,one.tel1,one.tel2,one.email);
|
|
|
|
|
if(!strcmp(one.name,namekey)) //<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD>ͬ
|
|
|
|
|
{
|
|
|
|
|
t=1;
|
|
|
|
|
printf("%-8s%-15s%-15s%-15s%-20s\n",one.name,one.place,one.tel1,one.tel2,one.email); //<2F><><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD><DABA><EFBFBD>if<69><66><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!t)
|
|
|
|
|
printf("δ<EFBFBD>ҵ<EFBFBD>\n");
|
|
|
|
|
fclose(fp);
|
|
|
|
|
}
|
|
|
|
|
//<2F><EFBFBD> 3.<2E><EFBFBD>
|
|
|
|
|
void modify()
|
|
|
|
|
{
|
|
|
|
|
int a;
|
|
|
|
|
char ch[10];
|
|
|
|
|
struct user one;
|
|
|
|
|
search();
|
|
|
|
|
if(t==1)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>1.<2E><><EFBFBD><EFBFBD> 2.<2E><><EFBFBD><EFBFBD> 3.<2E>绰1 4.<2E>绰2 5.<2E><><EFBFBD><EFBFBD>\n"); //<2F><EFBFBD><DEB8><EFBFBD>Ϣ<EFBFBD><CFA2>ʾ
|
|
|
|
|
scanf("%d",&a);
|
|
|
|
|
fp=fopen("user.txt","r+");
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>");
|
|
|
|
|
switch(a)
|
|
|
|
|
{
|
|
|
|
|
case 1: scanf("%s",one.name);fprintf(fp,"%-8s",one.name);break;
|
|
|
|
|
case 2: fseek(fp,offset+8,SEEK_SET);
|
|
|
|
|
scanf("%s",one.place);fprintf(fp,"%-15s",one.place);break;
|
|
|
|
|
case 3: fseek(fp,offset+23,SEEK_SET);
|
|
|
|
|
scanf("%s",one.tel1);fprintf(fp,"%-15s",one.tel1);break;
|
|
|
|
|
case 4: fseek(fp,offset+38,SEEK_SET);
|
|
|
|
|
scanf("%s",one.tel2);fprintf(fp,"%-15s",one.tel2);break;
|
|
|
|
|
case 5: fseek(fp,offset+53,SEEK_SET);
|
|
|
|
|
scanf("%s",one.email);fprintf(fp,"%-20s",one.email);break;
|
|
|
|
|
default: break;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("<EFBFBD>ijɹ<EFBFBD>\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//ɾ<><C9BE> 4.ɾ<><C9BE>
|
|
|
|
|
void dele()
|
|
|
|
|
{
|
|
|
|
|
char a;
|
|
|
|
|
for(;;)
|
|
|
|
|
{
|
|
|
|
|
search();
|
|
|
|
|
if(t==1)
|
|
|
|
|
break;
|
|
|
|
|
else
|
|
|
|
|
printf("<EFBFBD>˳<EFBFBD><EFBFBD>밴N,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
a=getchar();
|
|
|
|
|
if(a=='n'||a=='N')
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(t==1)
|
|
|
|
|
{
|
|
|
|
|
fp=fopen("user.txt","r+");
|
|
|
|
|
fseek(fp,offset,SEEK_SET);
|
|
|
|
|
fprintf(fp,"\n%-8s%-15s%-15s%-15s%-20s\n","","","","","");
|
|
|
|
|
fclose(fp);
|
|
|
|
|
printf("ɾ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD> 5.<2E><><EFBFBD><EFBFBD>
|
|
|
|
|
void look()
|
|
|
|
|
{
|
|
|
|
|
struct user one;
|
|
|
|
|
char c;
|
|
|
|
|
if((fp=fopen("user.txt","r"))==NULL) //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>user.txt
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>Ϣʧ<EFBFBD>ܣ<EFBFBD>\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
int m=0;
|
|
|
|
|
printf("%-8s%-15s%-15s%-15s%-20s\n","<EFBFBD><EFBFBD><EFBFBD><EFBFBD>","<EFBFBD><EFBFBD><EFBFBD><EFBFBD>","<EFBFBD>绰1","<EFBFBD>绰2","<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
while(!feof(fp))
|
|
|
|
|
{
|
|
|
|
|
fscanf(fp,"%s%s%s%s%s\n",one.name,one.place,one.tel1,one.tel2,one.email);
|
|
|
|
|
printf("%-8s%-15s%-15s%-15s%-20s\n",one.name,one.place,one.tel1,one.tel2,one.email);
|
|
|
|
|
m++;
|
|
|
|
|
}
|
|
|
|
|
if(fclose(fp)) //<2F>ر<EFBFBD><D8B1>ļ<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ر<EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>\n");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
}
|