string name; Console.WriteLine("请输入正确的名字:"); name = Console.ReadLine(); while (name != "正确的名字") { Console.WriteLine("名字错误,请重新输入!"); name = Console.ReadLine(); } Console.WriteLine("恭喜您,输入正确!");