TextWriter.WriteLineAsync TextWriter.WriteLineAsync TextWriter.WriteLineAsync TextWriter.WriteLineAsync Method

Definition

Writes data followed by a line terminator asynchronously to the text string or stream.

Overloads

WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken) WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken)
WriteLineAsync(String) WriteLineAsync(String) WriteLineAsync(String) WriteLineAsync(String)

Writes a string followed by a line terminator asynchronously to the text string or stream.

WriteLineAsync(Char[]) WriteLineAsync(Char[]) WriteLineAsync(Char[]) WriteLineAsync(Char[])

Writes an array of characters followed by a line terminator asynchronously to the text string or stream.

WriteLineAsync(StringBuilder, CancellationToken) WriteLineAsync(StringBuilder, CancellationToken)
WriteLineAsync() WriteLineAsync() WriteLineAsync() WriteLineAsync()

Writes a line terminator asynchronously to the text string or stream.

WriteLineAsync(Char) WriteLineAsync(Char) WriteLineAsync(Char) WriteLineAsync(Char)

Writes a character followed by a line terminator asynchronously to the text string or stream.

WriteLineAsync(Char[], Int32, Int32) WriteLineAsync(Char[], Int32, Int32) WriteLineAsync(Char[], Int32, Int32) WriteLineAsync(Char[], Int32, Int32)

Writes a subarray of characters followed by a line terminator asynchronously to the text string or stream.

WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken) WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken)

public virtual System.Threading.Tasks.Task WriteLineAsync (ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = null);
abstract member WriteLineAsync : ReadOnlyMemory<char> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.WriteLineAsync : ReadOnlyMemory<char> * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

Returns

WriteLineAsync(String) WriteLineAsync(String) WriteLineAsync(String) WriteLineAsync(String)

Writes a string followed by a line terminator asynchronously to the text string or stream.

public:
 virtual System::Threading::Tasks::Task ^ WriteLineAsync(System::String ^ value);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual System.Threading.Tasks.Task WriteLineAsync (string value);
abstract member WriteLineAsync : string -> System.Threading.Tasks.Task
override this.WriteLineAsync : string -> System.Threading.Tasks.Task
Public Overridable Function WriteLineAsync (value As String) As Task

Parameters

value
String String String String

The string to write. If the value is null, only a line terminator is written.

Returns

A task that represents the asynchronous write operation.

Exceptions

The text writer is currently in use by a previous write operation.

Remarks

The line terminator is defined by the CoreNewLine field.

The TextWriter class is an abstract class. Therefore, you do not instantiate it in your code. For an example of using the WriteLineAsync method, see the StreamWriter.WriteLineAsync method.

See also

WriteLineAsync(Char[]) WriteLineAsync(Char[]) WriteLineAsync(Char[]) WriteLineAsync(Char[])

Writes an array of characters followed by a line terminator asynchronously to the text string or stream.

public:
 System::Threading::Tasks::Task ^ WriteLineAsync(cli::array <char> ^ buffer);
[System.Runtime.InteropServices.ComVisible(false)]
public System.Threading.Tasks.Task WriteLineAsync (char[] buffer);
member this.WriteLineAsync : char[] -> System.Threading.Tasks.Task
Public Function WriteLineAsync (buffer As Char()) As Task

Parameters

buffer
Char[]

The character array to write to the text stream. If the character array is null, only the line terminator is written.

Returns

A task that represents the asynchronous write operation.

Exceptions

The text writer is currently in use by a previous write operation.

Remarks

The line terminator is defined by the CoreNewLine field.

See also

WriteLineAsync(StringBuilder, CancellationToken) WriteLineAsync(StringBuilder, CancellationToken)

public virtual System.Threading.Tasks.Task WriteLineAsync (System.Text.StringBuilder value, System.Threading.CancellationToken cancellationToken = null);
abstract member WriteLineAsync : System.Text.StringBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.WriteLineAsync : System.Text.StringBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

Returns

WriteLineAsync() WriteLineAsync() WriteLineAsync() WriteLineAsync()

Writes a line terminator asynchronously to the text string or stream.

public:
 virtual System::Threading::Tasks::Task ^ WriteLineAsync();
[System.Runtime.InteropServices.ComVisible(false)]
public virtual System.Threading.Tasks.Task WriteLineAsync ();
abstract member WriteLineAsync : unit -> System.Threading.Tasks.Task
override this.WriteLineAsync : unit -> System.Threading.Tasks.Task
Public Overridable Function WriteLineAsync () As Task

Returns

A task that represents the asynchronous write operation.

Exceptions

The text writer is currently in use by a previous write operation.

Remarks

The line terminator is defined by the CoreNewLine field.

See also

WriteLineAsync(Char) WriteLineAsync(Char) WriteLineAsync(Char) WriteLineAsync(Char)

Writes a character followed by a line terminator asynchronously to the text string or stream.

public:
 virtual System::Threading::Tasks::Task ^ WriteLineAsync(char value);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual System.Threading.Tasks.Task WriteLineAsync (char value);
abstract member WriteLineAsync : char -> System.Threading.Tasks.Task
override this.WriteLineAsync : char -> System.Threading.Tasks.Task
Public Overridable Function WriteLineAsync (value As Char) As Task

Parameters

value
Char Char Char Char

The character to write to the text stream.

Returns

A task that represents the asynchronous write operation.

Exceptions

The text writer is currently in use by a previous write operation.

Remarks

The line terminator is defined by the CoreNewLine field.

The TextWriter class is an abstract class. Therefore, you do not instantiate it in your code. For an example of using the WriteLineAsync method, see the StreamWriter.WriteLineAsync method.

See also

WriteLineAsync(Char[], Int32, Int32) WriteLineAsync(Char[], Int32, Int32) WriteLineAsync(Char[], Int32, Int32) WriteLineAsync(Char[], Int32, Int32)

Writes a subarray of characters followed by a line terminator asynchronously to the text string or stream.

public:
 virtual System::Threading::Tasks::Task ^ WriteLineAsync(cli::array <char> ^ buffer, int index, int count);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual System.Threading.Tasks.Task WriteLineAsync (char[] buffer, int index, int count);
abstract member WriteLineAsync : char[] * int * int -> System.Threading.Tasks.Task
override this.WriteLineAsync : char[] * int * int -> System.Threading.Tasks.Task
Public Overridable Function WriteLineAsync (buffer As Char(), index As Integer, count As Integer) As Task

Parameters

buffer
Char[]

The character array to write data from.

index
Int32 Int32 Int32 Int32

The character position in the buffer at which to start retrieving data.

count
Int32 Int32 Int32 Int32

The number of characters to write.

Returns

A task that represents the asynchronous write operation.

Exceptions

The index plus count is greater than the buffer length.

The text writer is currently in use by a previous write operation.

Remarks

The line terminator is defined by the CoreNewLine field.

The TextWriter class is an abstract class. Therefore, you do not instantiate it in your code. For an example of using the WriteLineAsync method, see the StreamWriter.WriteLineAsync method.

See also

Applies to