Advertisement
6_2008-2009 Files/ File Controls/ Input/ Output #199014

Read/Write Files with VBScript

Read and write textfiles with VBScript.

AI

Yapay Zeka Özeti: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kaynak Kod
original-source
rem This function will write a file.
rem Usage: WriteStuff <filename w/path>,<text to write>
Function WriteStuff(fileout,textout)
Dim filesys,filetxt
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.CreateTextFile(fileout,True)
filetxt.WriteLine(textout)
filetxt.Close
End Function
rem This function will read the contents of a textfile.
rem Usage: buffer = ReadStuff(<filename w/ path>)
Function ReadStuff(fileout)
Dim filesys,filetxt
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile(fileout)
ReadStuff = filetxt.ReadAll
filetxt.Close
End Function
Orijinal Yorumlar (3)
Wayback Machine'den kurtarıldı