Debug.Indent 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將目前的 IndentLevel 增加一個。
public:
static void Indent();
[System.Diagnostics.Conditional("DEBUG")]
public static void Indent();
[<System.Diagnostics.Conditional("DEBUG")>]
static member Indent : unit -> unit
Public Shared Sub Indent ()
- 屬性
範例
以下範例設定縮排層級並發出除錯訊息。
Debug.WriteLine("List of errors:");
Debug.Indent();
Debug.WriteLine("Error 1: File not found");
Debug.WriteLine("Error 2: Directory not found");
Debug.Unindent();
Debug.WriteLine("End of list of errors");
Debug.WriteLine("List of errors:")
Debug.Indent()
Debug.WriteLine("Error 1: File not found")
Debug.WriteLine("Error 2: Directory not found")
Debug.Unindent()
Debug.WriteLine("End of list of errors")
此範例會產生下列輸出:
List of errors:
Error 1: File not found
Error 2: Directory not found
End of list of errors