TnefPropertyReaderReadValueAsStringAsync Method

Asynchronously read the current value as a string.

Definition

Namespace: MimeKit.Tnef
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public Task<string> ReadValueAsStringAsync(
	CancellationToken cancellationToken = default
)

Parameters

cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskString
The value as a string.

Remarks

Reads any string or binary value as a string.

String8 and Binary values are decoded using the Codepage.

The value may only be read once.

If the value is larger than MaxPropertyValueLength or the remaining MaxTotalDataBytes allow, a DataSizeLimitExceeded issue is reported and an empty value is returned.

Exceptions

ObjectDisposedException The TnefReader has been disposed.
InvalidOperationException

The TnefReader has been advanced to another attribute.

-or-

The reader is not positioned on a value.

-or-

The value cannot be read as a string.

-or-

The value has already been read.

OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.

See Also