| GDFileIOReadTextAsync Method (IGDStorageFile) |
Reads the contents of the specified file and returns text.
Namespace:
GD
Assembly:
GD (in GD.dll) Version: 255.255.255.255
Syntax public static IAsyncOperation<string> ReadTextAsync(
IGDStorageFile file
)
public:
static IAsyncOperation<String^>^ ReadTextAsync(
[InAttribute] IGDStorageFile^ file
)
GD.GDFileIO.ReadTextAsync = function(file);
Parameters
- file
- Type: GDIGDStorageFile
The file to read.
Return Value
Type:
IAsyncOperationStringWhen this method completes successfully, it returns the contents of the file as a text string.
Remarks Examples
The following example shows how to read text from file in the SDK secure storage.
using GD;
...
try
{
var file = await GDWindows.Instance.SecureFolder.GetFileAsync("foo.bar");
if (file != null)
{
string text = await GDFileIO.ReadTextAsync(file);
}
}
catch (FileNotFoundException)
{
}
See Also