Click or drag to resize

ExtensionsFileIOReadTextAsync Method (FileInfo, Encoding)

Reads the contents of the specified file and returns text.

Namespace:  Cauldron
Assembly:  Cauldron (in Cauldron.dll) Version: 3.2.0.2
Syntax
public static Task<string> ReadTextAsync(
	this FileInfo file,
	Encoding encoding
)

Parameters

file
Type: System.IOFileInfo
The file to read.
encoding
Type: System.TextEncoding
The encoding applied to the contents of the file.

Return Value

Type: TaskString
When this method completes successfully, it returns the contents of the file as a text string.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FileInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also