我将 SysInternals DebugView 与我的 .Net 应用程序一起使用。我尝试使用 .Net Debug 类的 Indent 功能,但 DebugView 似乎只是将其表示为 NewLine 字符。
有谁知道是否可以让 DebugView 显示缩进?
示例代码:
static void Main (string[] args)
{
Debug.WriteLine("Indent level: {0}", Debug.IndentLevel);
Debug.Indent();
Debug.WriteLine("Indent level: {0}", Debug.IndentLevel);
Debug.Indent();
Debug.WriteLine("Indent level: {0}", Debug.IndentLevel);
Debug.Indent();
Debug.WriteLine("Indent level: {0}", Debug.IndentLevel);
Debug.Unindent();
Debug.WriteLine("Indent level: {0}", Debug.IndentLevel);
Debug.Unindent();
Debug.WriteLine("Indent level: {0}", Debug.IndentLevel);
Debug.Unindent();
Debug.WriteLine("Indent level: {0}", Debug.IndentLevel);
}
输出:
[9632] Indent level: 0
[9632]
[9632] Indent level: 1
[9632]
[9632]
[9632] Indent level: 2
[9632]
[9632]
[9632]
[9632] Indent level: 3
[9632]
[9632]
[9632] Indent level: 2
[9632]
[9632] Indent level: 1
[9632] Indent level: 0
我想看到的:
[9632] Indent level: 0
[9632] Indent level: 1
[9632] Indent level: 2
[9632] Indent level: 3
[9632] Indent level: 2
[9632] Indent level: 1
[9632] Indent level: 0
里克