Click or drag to resize
MimeKit

HeaderListLoadAsync(ParserOptions, String, CancellationToken) Method

Asynchronously load a HeaderList from the specified file.

Namespace: MimeKit
Assembly: MimeKit (in MimeKit.dll) Version: 4.3.0
Syntax
C#
public static Task<HeaderList> LoadAsync(
	ParserOptions options,
	string fileName,
	CancellationToken cancellationToken = default
)

Parameters

options  ParserOptions
The parser options.
fileName  String
The name of the file to load.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskHeaderList
The parsed list of headers.
Exceptions
ExceptionCondition
ArgumentNullException

options is null.

-or-

fileName is null.

ArgumentExceptionfileName is a zero-length string, contains only white space, or contains one or more invalid characters.
DirectoryNotFoundExceptionfileName is an invalid file path.
FileNotFoundException The specified file path could not be found.
UnauthorizedAccessException The user does not have access to read the specified file.
OperationCanceledException The operation was canceled via the cancellation token.
FormatException There was an error parsing the headers.
IOException An I/O error occurred.
Remarks
Loads a HeaderList from the file at the give file path, using the specified ParserOptions.
See Also