VBS:write and read file

Posted xinyueliu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VBS:write and read file相关的知识,希望对你有一定的参考价值。

fileName = "f.txt"
content = "blank context"

Dim objFSO
Set objFSO = CreateObject("scripting.filesystemobject")
absFileName = objFSO.GetAbsolutePathName(fileName)

Dim objStream
Set objStream = objFSO.CreateTextFile(fileName, True)
objStream.WriteLine(content)
objStream.Close

Dim objFile
Set objFile = objFSO.OpenTextFile(absFileName)
wscript.echo objFile.ReadAll

以上是关于VBS:write and read file的主要内容,如果未能解决你的问题,请参考以下文章

read and write in C

C: read/write

write之后为啥read不出来 为啥?

数据分析文摘:Reading and Writing JSON to a File in Python

[Python] Read and plot data from csv file

csv write and read