c 学生管理系统11(9)
时间:2025-04-23
时间:2025-04-23
break;
}
}
if (b == 0)
{
Console.WriteLine("查无此人,请确认是否输入正确");
Console.WriteLine("按回车键继续");
Console.ReadLine();
}
}
for (int i = 0; i < lines.Length; i++)
{
if (i != a + 1)
{
//将文件的数据付给字符串
tmep += lines[i] + "\r\n";
}
}
//创建文件并写入文件
File.WriteAllText(@".\学生管理系统文件.txt", tmep, Encoding.Default);//保存排除指定行的数据
}
//修改函数
static void Revise()
{
//File.Exists();检查文件是否存在
string[] lines = File.ReadAllLines(@".\学生管理系统文件.txt", Encoding.Default);
string[] arr = new string[11];
string[] xh = new string[lines.Length - 1];
string[] xm = new string[lines.Length - 1];
string[] xb = new string[lines.Length - 1];
string[] nl = new string[lines.Length - 1];
string[] dh = new string[lines.Length - 1];
string[] dz = new string[lines.Length - 1];
string[] bj = new string[lines.Length - 1];
string[] bz = new string[lines.Length - 1];
string[] yw = new string[lines.Length - 1];
string[] sx = new string[lines.Length - 1];
string[] yy = new string[lines.Length - 1];
for (int i = 1; i < lines.Length; i++)
{
string str = lines[i];
arr = str.Split('\t');