当前位置: 移动技术网 > IT编程>脚本编程>VBScript > VBS教程:方法-ReadAll 方法

VBS教程:方法-ReadAll 方法

2017年12月12日  | 移动技术网IT编程  | 我要评论

readall 方法

读入全部 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

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网