Read and write into a file using VBScript

前端 未结 9 1459
轮回少年
轮回少年 2020-11-27 06:34

How can we read and write some string into a text file using VBScript? I mean I have a text file which is already present so when I use this code below:-

Set         


        
9条回答
  •  轮回少年
    2020-11-27 07:24

    You could open two textstreams, one for reading

    Set filestreamIn = CreateObject("Scripting.FileSystemObject").OpenTextFile("C:\Test.txt,1)
    

    and one for appending

    Set filestreamOUT = CreateObject("Scripting.FileSystemObject").OpenTextFile("C:\Test.txt,8,true)
    

    The filestreamIN can read from the begining of the file, and the filestreamOUT can write to the end of the file.

提交回复
热议问题