当前位置: 首页 > 图文教程 > 脚本技术 > VBScript > VBS教程:方法-SkipLine 方法

VBScript
VBS教程:方法-Skip 方法
VBS教程:方法-Remove 方法
VBS教程:方法-ReadLine 方法
VBS教程:方法-ReadAll 方法
VBS教程:方法-Read 方法
VBS教程:方法-OpenTextFile 方法
VBS教程:方法-OpenAsTextStream 方法
VBS教程:方法-MoveFolder 方法
VBS教程:方法-MoveFile 方法
VBS教程:方法-Move 方法
VBS教程:方法-Keys 方法
VBS教程:方法-Items 方法
VBS教程:方法-GetTempName 方法
VBS教程:方法-GetSpecialFolder 方法
VBS教程:方法-GetParentFolderName 方法
VBS教程:方法-GetFolder 方法
VBS教程:方法-GetFileName 方法
VBS教程:方法-GetFile 方法
VBS教程:方法-GetExtensionName 方法
VBS教程:方法-GetDriveName 方法

VBScript 中的 VBS教程:方法-SkipLine 方法


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

SkipLine 方法

当读到 TextStream 文件时,跳过下一行。

object.SkipLine

object 应为 TextStream 对象名称。

说明

跳过一行意味着读并放弃本行所有字符并包括下一新行字符内容。 如果文件不是以读方式打开则会出现错误。

下面例子举例说明如何使用 SkipLine 方法:

Function SkipLineInFile Const ForReading = 1, ForWriting = 2 Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True) f.Write "嗨,你好!" & vbCrLf & "VB脚本很有趣!" Set f = fso.OpenTextFile("c:\testfile.txt", ForReading) f.SkipLine SkipLineInFile = f.ReadLineEnd Function