FileIO.ReadTextAsync Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
ReadTextAsync(IStorageFile) |
Lit le contenu du fichier spécifié et retourne du texte. |
ReadTextAsync(IStorageFile, UnicodeEncoding) |
Lit le contenu du fichier spécifié à l’aide de l’encodage de caractères spécifié et retourne du texte. |
ReadTextAsync(IStorageFile)
Lit le contenu du fichier spécifié et retourne du texte.
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)
Paramètres
- file
- IStorageFile
Fichier à lire.
Retours
Une fois cette méthode terminée, elle retourne le contenu du fichier sous forme de chaîne de texte.
- Attributs
Remarques
Tout objet qui implémente l’interface IStorageFile peut être passé à cette méthode ou à sa surcharge via le paramètre file .
Cette méthode utilise l’encodage de caractères du fichier spécifié. Si vous souhaitez spécifier un encodage différent, appelez plutôt ReadTextAsync(IStorageFile, UnicodeEncoding).
Voir aussi
S’applique à
ReadTextAsync(IStorageFile, UnicodeEncoding)
Lit le contenu du fichier spécifié à l’aide de l’encodage de caractères spécifié et retourne du texte.
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)
Paramètres
- file
- IStorageFile
Fichier à lire.
- encoding
- UnicodeEncoding
Encodage des caractères à utiliser.
Retours
Une fois cette méthode terminée, elle retourne le contenu du fichier sous forme de chaîne de texte.
- Attributs
Voir aussi
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour