Trace.AutoFlush 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public:
static property bool AutoFlush { bool get(); void set(bool value); };
public static bool AutoFlush { get; set; }
static member AutoFlush : bool with get, set
Public Shared Property AutoFlush As Boolean
属性值
注解
默认值为 false。
除非显式调用 Flush 或 Close调用流,否则刷新流不会刷新其基础编码器。
true设置为AutoFlush表示数据将从缓冲区刷新到流,但不会刷新编码器状态。 这使编码器能够保持其状态(部分字符),以便它可以正确编码下一个字符块。 此方案影响 UTF8 和 UTF7,其中某些字符只能在编码器接收相邻字符或字符后进行编码。
若要在 .NET Framework 应用中为 Trace 设置 AutoFlush 和 IndentSize,还可以编辑对应于应用程序名称的配置文件。 配置文件的格式应如以下示例所示:
<configuration>
<system.diagnostics>
<trace autoflush="false" indentsize="3" />
</system.diagnostics>
</configuration>