Click or drag to resize

ExtensionsFileIOReadTextAsync Method (DirectoryInfo, String, Encoding)

Reads the contents of the specified file and returns text.

Namespace:  Cauldron
Assembly:  Cauldron (in Cauldron.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public static Task<string> ReadTextAsync(
	this DirectoryInfo folder,
	string filename,
	Encoding encoding
)

Parameters

folder
Type: System.IODirectoryInfo
The folder where the file resides
filename
Type: SystemString
The name of 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 DirectoryInfo. 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