读入全部 textstream 文件并返回结果字符串。
object.readall
object 应为 textstream 对象的名称。
对于大文件,使用 readall 方法浪费内存资源。应该使用其他技术输入文件,例如按行读文件。
function readalltextfile const forreading = 1, forwriting = 2 dim fso, f set fso = createobject("scripting.filesystemobject") set f = fso.opentextfile("c:\testfile.txt", forwriting, true) f.write "世界你好!" set f = fso.opentextfile("c:\testfile.txt", forreading) readalltextfile = f.readallend function
如对本文有疑问, 点击进行留言回复!!
网友评论