FileIO.ReadTextAsync Methode

Definition

Überlädt

ReadTextAsync(IStorageFile)

Liest den Inhalt der angegebenen Datei und gibt Text zurück.

ReadTextAsync(IStorageFile, UnicodeEncoding)

Liest den Inhalt der angegebenen Datei mit der angegebenen Zeichencodierung und gibt Text zurück.

ReadTextAsync(IStorageFile)

Liest den Inhalt der angegebenen Datei und gibt Text zurück.

public:
 static IAsyncOperation<Platform::String ^> ^ ReadTextAsync(IStorageFile ^ file);
/// [Windows.Foundation.Metadata.Overload("ReadTextAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<winrt::hstring> ReadTextAsync(IStorageFile const& file);
[Windows.Foundation.Metadata.Overload("ReadTextAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<string> ReadTextAsync(IStorageFile file);
function readTextAsync(file)
Public Shared Function ReadTextAsync (file As IStorageFile) As IAsyncOperation(Of String)

Parameter

file
IStorageFile

Die zu lesende Datei.

Gibt zurück

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

Wenn diese Methode erfolgreich abgeschlossen wurde, gibt sie den Inhalt der Datei als Textzeichenfolge zurück.

Attribute

Hinweise

Jedes Objekt, das die IStorageFile-Schnittstelle implementiert, kann über den file-Parameter an diese Methode oder deren Überladung übergeben werden.

Diese Methode verwendet die Zeichencodierung der angegebenen Datei. Wenn Sie eine andere Codierung angeben möchten, rufen Sie stattdessen ReadTextAsync(IStorageFile, UnicodeEncoding) auf.

Weitere Informationen

Gilt für:

ReadTextAsync(IStorageFile, UnicodeEncoding)

Liest den Inhalt der angegebenen Datei mit der angegebenen Zeichencodierung und gibt Text zurück.

public:
 static IAsyncOperation<Platform::String ^> ^ ReadTextAsync(IStorageFile ^ file, UnicodeEncoding encoding);
/// [Windows.Foundation.Metadata.Overload("ReadTextWithEncodingAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<winrt::hstring> ReadTextAsync(IStorageFile const& file, UnicodeEncoding const& encoding);
[Windows.Foundation.Metadata.Overload("ReadTextWithEncodingAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<string> ReadTextAsync(IStorageFile file, UnicodeEncoding encoding);
function readTextAsync(file, encoding)
Public Shared Function ReadTextAsync (file As IStorageFile, encoding As UnicodeEncoding) As IAsyncOperation(Of String)

Parameter

file
IStorageFile

Die zu lesende Datei.

encoding
UnicodeEncoding

Die zu verwendende Zeichencodierung.

Gibt zurück

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

Wenn diese Methode erfolgreich abgeschlossen wurde, gibt sie den Inhalt der Datei als Textzeichenfolge zurück.

Attribute

Weitere Informationen

Gilt für: