c 学生管理系统11(7)
时间:2025-04-23
时间:2025-04-23
{
Console.WriteLine("你输入的姓名不存在!");
Console.WriteLine();
}
break;
case "3":
Console.WriteLine("请输入班级:");
string banji = Console.ReadLine();
int c = 1;
for (int i = 0; i < xh.Length; i++)
{
if (banji == bj[i])
{
Console.WriteLine("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10}", xh[i], xm[i], xb[i], nl[i], dh[i], dz[i], bj[i], bz[i], yw[i], sx[i], yy[i]);
Console.WriteLine();
c = i;
}
}
if (c == 1)
{
Console.WriteLine("你输入的班级不存在!");
Console.WriteLine();
}
break;
case "q":
ii = 1;//跳出循环
break;
default:
Console.WriteLine("输入有误!请重新输入!");
Console.WriteLine();
break;
}
}
}
//删除函数
static void Delete()
{
//File.Exists();检查文件是否存在
string[] lines = File.ReadAllLines(@".\学生管理系统文件.txt", Encoding.Default);
string[] arr = new string[11];
string[] xh = new string[lines.Length - 1];