SkipLine 方法當(dāng)讀到 TextStream 文件時(shí),跳過(guò)下一行。 object.SkipLine
object 應(yīng)為 TextStream 對(duì)象名稱(chēng)。 說(shuō)明跳過(guò)一行意味著讀并放棄本行所有字符并包括下一新行字符內(nèi)容。 如果文件不是以讀方式打開(kāi)則會(huì)出現(xiàn)錯(cuò)誤。 下面例子舉例說(shuō)明如何使用 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.ReadLine End Function
請(qǐng)參閱Close 方法 | Read 方法 | ReadAll 方法 | ReadLine 方法 | Skip 方法 | Write 方法 | WriteLine 方法 | WriteBlankLines 方法 應(yīng)用于: TextStream 對(duì)象 返回首頁(yè) |