master
子烨 梅 6 years ago
parent 8b3c382687
commit 8e05eb4bfc

Binary file not shown.

@ -27,14 +27,9 @@ void REGISTCOM() { //
struct userna_pw *regi1=(struct userna_pw*)malloc(sizeof(struct userna_pw));
FILE *fp;
fp = fopen("username_pwCOM.txt", "a+"); //******************* //将用户名用结构数组存入文件
//memset(regi1->name1, 0, 101 * sizeof(char));
//memset(regi1->passd1, 0, 101 * sizeof(char));
//memset(regi1->passd2, 0, 101 * sizeof(char));
printf("\t*************************\n");
printf("\t* 请输入你的用户名 *\n");
gets_s(regi1->name1);
//na0 = &uni0;
//pw0 = na0;
while (1) {
printf("\t* 请输入你的密码 *\n");
gets_s(regi1->passd1); //将密码用相同结构数组存入文件
@ -46,13 +41,7 @@ void REGISTCOM() { //
printf("\t* 请重新输入 *\n");
}
else {
//strcpy(regi_n->name, regi1.name1);
//strcpy(regi_p->pw, regi1.passd1);
fwrite(regi1,sizeof(struct userna_pw),1 ,fp);
//fputs("\n", fp);
//fputs(regi1.passd1, fp);
//fputs("\n", fp);
printf("*注册成功*\n");
system("pause");
fclose(fp);
@ -251,24 +240,10 @@ void PRINTF1_1()
if (strstr(chec->word_, tempor) !=NULL) {
printf("\n");
printf("%s", chec->word_);
//fread(strstr(((struct w_word *)check)->trans_, tempor), sizeof(struct w_word), 20, fp);
//puts(check->trans_);
//printf("\n");
//printf("例句.\t");
//fwrite(((struct w_word *)check)->setence, sizeof(struct w_word),20, fp);
//puts(check->setence);
printf("\n");
//x = 1;
//break;
//system("pause");
}
}
rewind(fp);
//fclose(fp);
//printf("\t* 回车健进行下一步 \n");
//system("pause");
//FILE *fpp;
//fpp = fopen("wordd.txt", "r");
while (fread(check, sizeof(struct w_word),1, fp) != NULL) {
if (strstr(check->word_, tempor) == (char *)(check->word_)) {
printf("\n");
@ -282,11 +257,8 @@ void PRINTF1_1()
printf("\n");
x = 1;
break;
//system("pause");
}
}
//system("pause");
//printf("\t* 回车健进行下一步 \n");
system("pause");
if(x==0) {
@ -492,19 +464,12 @@ void IMPORT() { //
printf("\n");
printf("\t* 请输入单词 *\n");
scanf("%s",&(tr + i)->word_);
//(tr + i)->word_[strlen((tr + i)->word_) ]='\0';
//fputs((wd+i)->word_, fp2);
//fputs(" ", fp2);
printf("\t* 请输入前面单词的翻译 *\n");
scanf("%s", &(tr + i)->trans_);
getchar();
//fputs((tr + i)->trans_, fp2);
//fputs("\n", fp2);
printf("\n");
printf("\t* 请输入前面单词的例句 *\n");
gets_s((tr+ i)->setence);
//fputs((wd + i)->setence, fp2);
//fputs("\n", fp2);
rewind(fp2);
while (feof(fp2) != EOF) {
while (fread(wd, sizeof(struct w_word), 1, fp2) != NULL) {
@ -521,7 +486,6 @@ void IMPORT() { //
fwrite((tr+i),sizeof(struct w_word),1,fp2);
printf("\n");
}
//rewind(fp2);
fclose(fp2);
return;
@ -551,7 +515,7 @@ void VIEW() { //
}
//查看和管理用户
void LOANDMA() {
int x = 0;
int x = 0,at=0;
struct userna_pw *usp=(struct userna_pw*)malloc(sizeof(struct userna_pw));
char number[100];
//char n[20];
@ -564,20 +528,20 @@ void LOANDMA() {
return;
}
else {
while (feof(fp5) != EOF) {
while (fread(usp,sizeof(struct userna_pw),1,fp5) != NULL) {
while (!feof(fp5)) {
if(fread(usp,sizeof(struct userna_pw),1,fp5) != NULL) {
printf("****用户名:");
puts(usp->name1);
printf("****密码:");
puts(usp->passd1);
at = 1;
}
break;
}
}
//fflush(fp5);
fclose(fp5);
system("pause");
//system("pause");
if (at == 1) {
printf("\t* 是否选择删除用户 *\n");
printf("\t* 1.是 2.否 *\n");
char keyy = getch();
@ -645,10 +609,12 @@ void LOANDMA() {
return;
}
}
else {
return;
printf("\t************-ÎÞÓû§-**************\n");
system("pause");
}
return;
}
//存单词记录本
void WORD_CO(struct w_word *inpu) {
@ -666,14 +632,6 @@ void FWORD_CO() {
printf("\t* 单词记录本 *\n");
printf("\t*****************************************\n");
struct w_word *fword=(struct w_word *)malloc(sizeof(struct w_word));
//struct word_coll {
// char word1[100];
// char trans1[200];
// struct word_coll *next;
// int a;
//};
//struct word_coll *head = NULL;
//struct word_coll *prev=NULL, *current;
char input[50];
FILE *fp7;
fp7 = fopen("word_coll.txt", "r");
@ -682,18 +640,12 @@ void FWORD_CO() {
system("pause");
return;
}
while (feof(fp7) != EOF) {
while (fread(fword, sizeof(struct w_word), 1, fp7) != NULL && input[0] != '\0') {
//current = (struct word_coll*)malloc(sizeof(struct word_coll));
//if (head == NULL)
// head = current;
//else
//prev->next = current;
//current->next = NULL;
while (!feof(fp7)) {
if(fread(fword, sizeof(struct w_word), 1, fp7) != NULL && input[0] != '\0') {
printf("\t");
puts(fword->word_);
printf("\t");
puts(fword->trans_);
//prev = current;
//memset(input, 0, sizeof(char) * 50);
}
}
printf("\t**************回车键返回*****************\n");
@ -710,39 +662,26 @@ void QUE(struct w_word *input) {
}
//显示查询记录
void FQUE() {
int n=1;
system("cls");
printf("\t*****************************************\n");
printf("\t* 查询记录 *\n");
printf("\t*****************************************\n");
struct w_word *fque = (struct w_word *)malloc(sizeof(struct w_word));
//struct query_l {
// char word2[100];
// char trans2[200];
// struct query_l *next;
// int a;
//};
//struct query_l *head = NULL;
//struct query_l *prev=NULL , *current;
//char inputt[50];
FILE *fp7;
fp7 = fopen("query log.txt", "r");
while (feof(fp7) != EOF) {
while (fread(fque, sizeof(struct w_word), 1,fp7) != NULL) {
//current = (struct query_l*)malloc(sizeof(struct query_l));
//if (head == NULL)
// head = current;
//else
// prev->next = current;
//current->next = NULL;
while (!feof(fp7)) {
if(fread(fque, sizeof(struct w_word), 1,fp7) != NULL) {
printf("********%d********\n", n);
n++;
printf("\t");
puts(fque->word_);
printf("\t");
puts(fque->trans_);
//prev = current;
//memset(inputt, 0, sizeof(char) * 50);
}
}
printf("\t**************回车键返回*****************\n");
while (getchar() != '\n')
continue;
system("pause");
return;
}
//排序并显示单词表
Loading…
Cancel
Save