1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Lecture ligne à ligne d'un fichier texte :
VBS
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Set oFso = CreateObject("Scripting.FileSystemObject")
Set f = oFso.OpenTextFile("c:\tmp\fichier1.txt", ForReading)
while Not f.AtEndOfStream
wscript.echo f.ReadLine
Wend
f.Close
Lecture de la totalité d'un fichier texte :
VBS
Const ForReading = 1, ForWriting = 2
Dim oFso, f
Set oFso = CreateObject("Scripting.FileSystemObject")
Set f = oFso.OpenTextFile("c:\tmp\fichier1.txt", ForReading)
Wscript.echo f.ReadAll
f.Close |
Partager