我有我的菜单的方法,但它并没有结束......
static public int Menu(string M_1, string M_2, string M_3, string M_4) {
int menu = 0;
Write("1. " + M_1, 10, false);
Write("2. " + M_2, 11, false);
if (M_3 != "") {
Write("3. " + M_3, 12, false);
}
if (M_4 != "") {
Write("4. " + M_4, 13, false);
}
Console.Write("\n\nWrite a numbere of an Action and press ENTER: ");
while (true) {
menu = Console.Read();
if (menu != 1 || menu != 2 || menu != 3 || menu != 4) {
continue;
} else {
break;
}
}
return menu;
}
主要方法: ...
int menu1 = Menu("First", "Secong", "Third", "");
switch (menu1) {
case 1:
Console.Clear();
Vypsat("You choose action 1.", 35);
Console.ReadKey();
break;
...
如果我运行程序并按一个数字并 Enter,一切都保持不变。:(那里有什么问题?