无法理解这个"检测到无法访问的代码"错误

mis*_*das 0 c#

我有这段代码给我带来了麻烦.

最后一个break语句给出了"检测到无法访问的代码"的错误

这导致了我的计划中的逻辑缺陷.

有人可以找出问题吗?

谢谢!

        case 127232:
            case1 = splited[0];
            changeRow[inServer] = "Audit Privileges and Logs:\n";
            changeRow[inServer + " Exception"] = "No Exception";
            writeToFile(Directory.GetCurrentDirectory() + @"\" + inServer + "127232.txt", case1);


            if (case1.Contains("audit level;failure") || case1.Contains("audit level;all"))
                {
                    Console.WriteLine("success!");
                        changeRow[inServer + "Observations"] = changeRow[inServer + "Observations"] + "1) Audit options found .";
                        changeRow[inServer] = changeRow[inServer] + "string pattern audit level;failure or auditlevel;all found";
                        break;
                }

                else 
                {
                    //Audit Privileges should have been in enabled for sys and system accounts or the security administrator.
                    changeRow[inServer + "Observations"] = changeRow[inServer + "Observations"] + "1) No audit options found.";
                    changeRow[inServer] = changeRow[inServer] + "Correct audit options not configured!";
                    changeRow[inServer + " Exception"] = "Exception";
                    break;
                }
            break;
Run Code Online (Sandbox Code Playgroud)

Cod*_*aos 7

无论是thenelse你的部分if条款包含break.很明显,代码之后的代码if永远不会被执行.