共用方式為


Debug.Indent 方法

定義

將目前的 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 ()
屬性

範例

下列範例會設定縮排層級,併發出偵錯訊息。

#if defined(DEBUG)
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" );
#endif
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

適用於

另請參閱