Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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, followed by a line terminator.
WriteLine(Object) |
Writes the value of the object's ToString() method to the listener you create when you implement the TraceListener class, followed by a line terminator. |
WriteLine(String) |
When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator. |
WriteLine(Object, String) |
Writes a category name and the value of the object's ToString() method to the listener you create when you implement the TraceListener class, followed by a line terminator. |
WriteLine(String, String) |
Writes a category name and a message to the listener you create when you implement the TraceListener class, followed by a line terminator. |
Writes the value of the object's ToString() method to the listener you create when you implement the TraceListener class, followed by a line terminator.
public:
virtual void WriteLine(System::Object ^ o);
public virtual void WriteLine(object? o);
public virtual void WriteLine(object o);
abstract member WriteLine : obj -> unit
override this.WriteLine : obj -> unit
Public Overridable Sub WriteLine (o As Object)
The typical line terminator you might implement is a carriage return followed by a line feed (\r\n).
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator.
public:
abstract void WriteLine(System::String ^ message);
public abstract void WriteLine(string? message);
public abstract void WriteLine(string message);
abstract member WriteLine : string -> unit
Public MustOverride Sub WriteLine (message As String)
A message to write.
The typical line terminator you might implement is a carriage return followed by a line feed (\r\n).
When inheriting from this class, you must implement this method. To support an indentation, call WriteIndent() if NeedIndent is true
. To indent the following line, you must reset NeedIndent to true
.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Writes a category name and the value of the object's ToString() method to the listener you create when you implement the TraceListener class, followed by a line terminator.
public:
virtual void WriteLine(System::Object ^ o, System::String ^ category);
public virtual void WriteLine(object? o, string? category);
public virtual void WriteLine(object o, string category);
abstract member WriteLine : obj * string -> unit
override this.WriteLine : obj * string -> unit
Public Overridable Sub WriteLine (o As Object, category As String)
A category name used to organize the output.
The typical line terminator you might implement is a carriage return followed by a line feed (\r\n).
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Writes a category name and a message to the listener you create when you implement the TraceListener class, followed by a line terminator.
public:
virtual void WriteLine(System::String ^ message, System::String ^ category);
public virtual void WriteLine(string? message, string? category);
public virtual void WriteLine(string message, string category);
abstract member WriteLine : string * string -> unit
override this.WriteLine : string * string -> unit
Public Overridable Sub WriteLine (message As String, category As String)
A message to write.
A category name used to organize the output.
The typical line terminator you might implement is a carriage return followed by a line feed (\r\n).
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Please sign in to use this experience.
Sign in