Advertisement
C_Volume2 Files/ File Controls/ Input/ Output #78427

Read/Write Files with VBScript

Read and write textfiles with VBScript.

AI

AIサマリー: 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.

ソースコード
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
オリジナルのコメント (3)
Wayback Machineから復元