vbscript – FileSystemObject.OpenTextFile

**METHOD:** `fso.OpenTextFile(path, iomode[, create[, format]])`

**Description**
Ouvre un fichier texte et retourne un `TextStream` pour lire/écrire.

**Syntax**
`fso.OpenTextFile(path, iomode[, create[, format]])`

**Paramètres**
– `path` : Chemin du fichier.
– `iomode` : 1=ForReading, 2=ForWriting, 8=ForAppending

**Retour**
Un objet `TextStream`.

**Exemples**
« `vb
Dim fso, ts
Set fso = CreateObject(« Scripting.FileSystemObject »)
Set ts = fso.OpenTextFile(« C:tempdemo.txt », 1)
WScript.Echo ts.ReadAll
ts.Close
« `

**Voir aussi**
`FileSystemObject.CreateTextFile`, `TextStream.ReadLine`, `TextStream.WriteLine`

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *