有下面一段代码:
do
{
myChoice = om.getChoice();
// Make a decision based on the user's choice
switch (myChoice)
{
case "A":
case "a":
Console.WriteLine("You wish to add an address.");
break;
case "D":
case "d":
Console.WriteLine("You wish to delete an address.");
break;
case "M":
case "m":
Console.WriteLine("You wish to modify an address.");
break;
case "V":
case "v":
Console.WriteLine("You wish to view the address list.");
break;
case "Q":
case "q":
Console.WriteLine("Bye.");
break;
default:
Console.WriteLine("{0} is not a valid choice", myChoice);
}
结果却显示:错误 CS0163: 控制不能从一个 case 标签(“default:”)贯穿到另一个 case 标签作者: fwbook 时间: 2010-8-13 21:58