C# Unreachable code detected

后端 未结 5 2557
抹茶落季
抹茶落季 2021-02-20 18:57

I\'m getting a \"Unreachable code detected\" message in Visual Studio at the point i++ in my code below. Can you spot what I\'ve done wrong?

try
{
    RegistryKe         


        
5条回答
  •  误落风尘
    2021-02-20 19:32

    The problem is that because you break; in the loop with no chance of it doing anything else, the increment of i (i++) will never be reached.

提交回复
热议问题