Trace.Unindent 方法
将当前的 IndentLevel 减少 1。
**命名空间:**System.Diagnostics
**程序集:**System(在 system.dll 中)
语法
声明
<ConditionalAttribute("TRACE")> _
Public Shared Sub Unindent
用法
Trace.Unindent
[ConditionalAttribute("TRACE")]
public static void Unindent ()
[ConditionalAttribute(L"TRACE")]
public:
static void Unindent ()
/** @attribute ConditionalAttribute("TRACE") */
public static void Unindent ()
ConditionalAttribute("TRACE")
public static function Unindent ()
示例
下面的示例递增和递减缩进级别,并发出跟踪消息。
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")
该示例产生下面的输出:
List of errors:
Error 1: File not found
Error 2: Directory not found
End of list of errors
平台
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 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0
请参见
参考
Trace 类
Trace 成员
System.Diagnostics 命名空间
Indent
IndentLevel
IndentSize