Freigeben über


Trace.Indent-Methode

Erhöht den aktuellen IndentLevel um eins.

Namespace: System.Diagnostics
Assembly: System (in system.dll)

Syntax

'Declaration
<ConditionalAttribute("TRACE")> _
Public Shared Sub Indent
'Usage

Trace.Indent
[ConditionalAttribute("TRACE")] 
public static void Indent ()
[ConditionalAttribute(L"TRACE")] 
public:
static void Indent ()
/** @attribute ConditionalAttribute("TRACE") */ 
public static void Indent ()
ConditionalAttribute("TRACE") 
public static function Indent ()

Beispiel

Im folgenden Beispiel wird der Einzug vergrößert und verkleinert, und es werden Meldungen für die Ablaufverfolgung ausgegeben.

Trace.WriteLine("List of errors:")
Trace.Indent()
Trace.WriteLine("Error 1: File not found")
Trace.WriteLine("Error 2: Directory not found")
Trace.Unindent()
Trace.WriteLine("End of list of errors")
Trace.WriteLine("List of errors:");
 Trace.Indent();
 Trace.WriteLine("Error 1: File not found");
 Trace.WriteLine("Error 2: Directory not found");
 Trace.Unindent();
 Trace.WriteLine("End of list of errors");
   
Trace::WriteLine( "List of errors:" );
Trace::Indent();
Trace::WriteLine( "Error 1: File not found" );
Trace::WriteLine( "Error 2: Directory not found" );
Trace::Unindent();
Trace::WriteLine( "End of list of errors" );
Trace.WriteLine("List of errors:");
Trace.Indent();
Trace.WriteLine("Error 1: File not found");
Trace.WriteLine("Error 2: Directory not found");
Trace.Unindent();
Trace.WriteLine("End of list of errors");
Trace.WriteLine("List of errors:")
Trace.Indent()
Trace.WriteLine("Error 1: File not found")
Trace.WriteLine("Error 2: Directory not found")
Trace.Unindent()
Trace.WriteLine("End of list of errors")

Mit diesem Beispiel wird die folgende Ausgabe erzeugt:

List of errors:
     Error 1: File not found
     Error 2: Directory not found
End of list of errors
   

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

Trace-Klasse
Trace-Member
System.Diagnostics-Namespace
Unindent
IndentLevel
IndentSize