Notiz
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Iech unzemellen oder Verzeechnesser ze änneren.
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Verzeechnesser ze änneren.
Control cannot fall through from one case label ('label') to another
When a switch statement contains more than one switch section, you must explicitly terminate each section, including the last one, by using one of the following keywords:
If you want to implement "fall through" behavior from one section to the next, use goto case #
.
The following sample generates CS0163.
// CS0163.cs
public class MyClass
{
public static void Main()
{
int i = 0;
switch (i) // CS0163
{
// Compiler error CS0163 is reported on the following line.
case 1:
i++;
// To resolve the error, uncomment one of the following example statements.
// return;
// break;
// goto case 3;
case 2:
i++;
return;
case 3:
i = 0;
return;
// Compiler error CS0163 is reported on the following line.
default:
Console.WriteLine("Default");
// To resolve the error, uncomment the following line:
//break;
}
}
Feedback zu .NET
.NET ass en Open-Source-Projet. Wielt e Link, fir Feedback ze ginn: