当前位置: 移动技术网 > IT编程>脚本编程>VBScript > VBS教程:属性-AtEndOfLine 属性

VBS教程:属性-AtEndOfLine 属性

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

atendofline 属性

textstream 文件中,如果文件指针指向行末标记,就返回 true;否则如果不是只读则返回 false

object.atendofline

object 应为 textstream 对象的名称。

说明

atendofline 属性仅应用于以读方式打开的 textstream 文件,否则会出现错误。

下列代码举例说明如何使用 atendofline 属性:

function readentirefile(filespec)  const forreading = 1  dim fso, thefile, retstring  set fso = createobject("scripting.filesystemobject")  set thefile = fso.opentextfile(filespec, forreading, false)  do while thefile.atendofline <> true    retstring = thefile.read(1)  loop  thefile.close  readentirefile = retstringend function

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

相关文章:

验证码:
移动技术网