Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.35 KB

pathio_readtextasync_532716801.md

File metadata and controls

36 lines (26 loc) · 1.35 KB
-api-id -api-type
M:Windows.Storage.PathIO.ReadTextAsync(System.String)
winrt method

Windows.Storage.PathIO.ReadTextAsync

-description

Reads the contents of the file at the specified path or Uniform Resource Identifier (URI) and returns text.

-parameters

-param absolutePath

The path of the file to read.

-returns

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

-remarks

-examples

This example shows you how to use readTextAsync(absolutePath) to read text from the file at the path in absoluteFilePath like this:

Windows.Storage.PathIO.readTextAsync(absoluteFilePath).then(function (contents) {
    // Add code to process the text read from the file
});

You can use then or done to declare a function to capture and process the text that was read from the file. After the readTextAsync method completes, the text will be passed to this function as a string object (contents in the example).

-see-also

ReadTextAsync(String, UnicodeEncoding)