65 lines
1.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// Created by CC-star on 25-5-9.
//
#include <stdio.h>
#include "./Shear/C3_shear.h"
int C3_User();
int C3_Admin();
void Update_MusicInfo();
//文件大小
int File_information_size() {
FILE *fp = fopen(MUSIC_PATH, "r");
if (fp == NULL) {
printf("无法打开歌曲列表文件该程序无法正常使用请先创建歌曲列表文件music_list.txt\n");
return 3;
}
fseek(fp, 0, SEEK_END);
long fileSize= ftell(fp);
// rewind(fp);
fclose(fp);
if (fileSize == 0) {
printf("无歌曲信息,自动更新音乐歌单\n");
return 2;
}else {
return 1;
}
}
int C3main() {
int ret = File_information_size();
if (ret== 3) {
return 0;
} else if (ret == 2) {
Update_MusicInfo();
}
while (1) {
printf("\n---------------------👇点歌台管理控制面板👇----------------------\n");
printf("1游客登入\n2管理员登入\n");
printf("0.返回主控制台\n");
printf("-----------------------👆选择对应数字👆------------------------\n");
printf("请输入选择:");
int opt;
scanf("%d", &opt);
while (getchar() != '\n');
switch (opt) {
case 1:
C3_User();
break;
case 2:
C3_Admin();
break;
case 0:
printf("⚠️返回主控制台中...⚠️\n");
return 0;
default:
printf("⚠️输入有误,请重新输入⚠️\n");
break;
}
}
}