我有这段代码给我带来了麻烦.
最后一个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)