当前位置: 首页 > 图文教程 > 脚本技术 > VBScript > VBS教程:属性-AtEndOfStream 属性

VBScript
VBS教程:VBscript语句-Execute 语句
VBS教程:VBscript语句-Erase 语句
VBS教程:VBscript语句-Do...Loop 语句
VBS教程:VBscript语句-Dim 语句
VBS教程:VBscript语句-Const 语句
VBS教程:VBscript语句-Class 语句
VBS教程:VBscript语句-Call 语句
VBS教程:VBscript语句-功能介绍
VBS教程:VBscript属性-Value 属性
VBS教程:VBscript属性-Source 属性
VBS教程:VBscript属性-Pattern 属性
VBS教程:VBscript属性-Number 属性
VBS教程:VBscript属性-Length 属性
VBS教程:VBscript属性-IgnoreCase 属性
VBS教程:VBscript属性-HelpFile 属性
VBS教程:VBscript属性-HelpContext 属性
VBS教程:VBscript属性-Global 属性
VBS教程:VBscript属性-FirstIndex 属性
VBS教程:VBscript属性-Description 属性
VBS教程:VBscript属性-功能介绍

VBScript 中的 VBS教程:属性-AtEndOfStream 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-11   浏览: 90 ::
收藏到网摘: n/a

AtEndOfStream 属性

如果文件指针位于 TextStream 文件末,则返回 True;否则如果不为只读则返回 False

object.AtEndOfStream

object 应为 TextStream 对象的名称。

说明

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

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

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.AtEndOfStream <> True retstring = theFile.ReadLine Loop theFile.Close ReadEntireFile = retstringEnd Function