TraceListener.Write 方法

定义

实现 ToString() 类时,向所创建的侦听器写入消息、类别名称或对象的 TraceListener 方法值。Writes a message, category name, or the value of an object's ToString() method to the listener you create when you implement the TraceListener class.

重载

Write(Object)

实现 ToString() 类时,向所创建的侦听器写入对象的 TraceListener 方法值。Writes the value of the object's ToString() method to the listener you create when you implement the TraceListener class.

Write(String)

在派生类中被重写时,向在该派生类中所创建的侦听器写入指定消息。When overridden in a derived class, writes the specified message to the listener you create in the derived class.

Write(Object, String)

实现 ToString() 类时,向所创建的侦听器写入类别名称和对象的 TraceListener 方法值。Writes a category name and the value of the object's ToString() method to the listener you create when you implement the TraceListener class.

Write(String, String)

实现 TraceListener 类时,向所创建的侦听器写入类别名称和消息。Writes a category name and a message to the listener you create when you implement the TraceListener class.

Write(Object)

实现 ToString() 类时,向所创建的侦听器写入对象的 TraceListener 方法值。Writes the value of the object's ToString() method to the listener you create when you implement the TraceListener class.

public:
 virtual void Write(System::Object ^ o);
public virtual void Write (object? o);
public virtual void Write (object o);
abstract member Write : obj -> unit
override this.Write : obj -> unit
Public Overridable Sub Write (o As Object)

参数

o
Object

要为其编写完全限定类名的 ObjectAn Object whose fully qualified class name you want to write.

另请参阅

适用于

Write(String)

在派生类中被重写时,向在该派生类中所创建的侦听器写入指定消息。When overridden in a derived class, writes the specified message to the listener you create in the derived class.

public:
 abstract void Write(System::String ^ message);
public abstract void Write (string? message);
public abstract void Write (string message);
abstract member Write : string -> unit
Public MustOverride Sub Write (message As String)

参数

message
String

要写入的消息。A message to write.

实施者说明

从此类继承时,必须实现此方法。When inheriting from this class, you must implement this method. 若要支持缩进,应在 WriteIndent() NeedIndent 为时调用 trueTo support an indentation, you should call WriteIndent() if NeedIndent is true. 如果需要缩进以下行,则必须将重置 NeedIndenttrueIf you need to indent the following line, you must reset NeedIndent to true.

另请参阅

适用于

Write(Object, String)

实现 ToString() 类时,向所创建的侦听器写入类别名称和对象的 TraceListener 方法值。Writes a category name and the value of the object's ToString() method to the listener you create when you implement the TraceListener class.

public:
 virtual void Write(System::Object ^ o, System::String ^ category);
public virtual void Write (object? o, string? category);
public virtual void Write (object o, string category);
abstract member Write : obj * string -> unit
override this.Write : obj * string -> unit
Public Overridable Sub Write (o As Object, category As String)

参数

o
Object

要为其编写完全限定类名的 ObjectAn Object whose fully qualified class name you want to write.

category
String

用于组织输出的类别名称。A category name used to organize the output.

另请参阅

适用于

Write(String, String)

实现 TraceListener 类时,向所创建的侦听器写入类别名称和消息。Writes a category name and a message to the listener you create when you implement the TraceListener class.

public:
 virtual void Write(System::String ^ message, System::String ^ category);
public virtual void Write (string? message, string? category);
public virtual void Write (string message, string category);
abstract member Write : string * string -> unit
override this.Write : string * string -> unit
Public Overridable Sub Write (message As String, category As String)

参数

message
String

要写入的消息。A message to write.

category
String

用于组织输出的类别名称。A category name used to organize the output.

另请参阅

适用于