System.IOUtils.TFile.AppendAllText

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

class procedure AppendAllText(const Path, Contents: string); overload; static;
class procedure AppendAllText(const Path, Contents: string;
const Encoding: TEncoding); overload; static;

C++

static void __fastcall AppendAllText(const System::UnicodeString Path, const System::UnicodeString Contents)/* overload */;
static void __fastcall AppendAllText(const System::UnicodeString Path, const System::UnicodeString Contents, System::Sysutils::TEncoding* const Encoding)/* overload */;

Propriétés

Type Visibilité  Source Unité  Parent
procedure
function
public
System.IOUtils.pas
System.IOUtils.hpp
System.IOUtils TFile

Description

Ajoute un texte donné à la fin d'un fichier.

Utilisez AppendAllText pour ajouter un texte donné à la fin d'un fichier. Si le fichier spécifié par le paramètre Path existe, le texte y est ajouté. Sinon, le fichier est créé et rempli avec le texte donné. Le tableau suivant liste les paramètres attendus par cette méthode.



Nom Signification

Path

Le chemin au fichier.

Contents

La chaîne contenant le texte à ajouter.

Encoding

L'encodage utilisé pour le texte ajouté.



Remarque :  AppendAllText déclenche une exception si le fichier est inaccessible ou si le chemin n'est pas valide.

Voir aussi