此浏览器不再受支持。
请升级到 Microsoft Edge 以使用最新的功能、安全更新和技术支持。
如果想要仅在调试时将任何一行写入调试控制台,应使用哪种 API?
System.Console.WriteLine
System.Diagnostics.Trace.WriteLine
System.Diagnostics.Debug.WriteLine
System.WriteLine
如果想要仅在计数为 0 时编写调试消息,应使用哪些代码?
0
Debug.Assert(count != 0, "Count should not be 0.");
Debug.Assert(count == 0, "Count should not be 0.");
Debug.WriteIf(count != 0, "Count should not be 0.");
Debug.WriteIf(count == 0, "Count should not be 0.");
调试器提供的前两个值是什么?
控制程序执行,以及观察程序状态
修改程序值,以及更改程序输出
观察程序状态,以及修改程序值
在运行时编辑程序,以及编辑程序值
哪个 Visual Studio Code 调试器面板最适用于观察跨不同函数的特定变量的当前值?
使用“变量”面板,因为它显示当前位于范围中的所有变量。
将鼠标悬停在代码编辑器中的变量上以显示值。
使用“监视”面板可以选择特定变量或表达式,以在程序的执行过程中进行监视。
使用“调用堆栈”面板。
在检查工作前,必须回答所有问题。
继续
此页面是否有帮助?