今天写C#代码,其中switch代码块的时候,default语句编译报错:

Error   6   Control cannot fall through from one case label ('default:') to another D:\ContractItemExtension.cs    110 17  Server.UI


这让一直写java和js的俺,莫名其妙。

查了一下资料:

http://stackoverflow.com/questions/3455208/why-do-you-need-to-put-break-after-the-last-label-of-a-switch-statement


加上break;搞定!


相关链接:

http://blog.zhaojie.me/2011/05/javascript-when-break-is-not-the-last-choice-of-switch.html