ASP SkipLine 方法

定义和用法

SkipLine 方法在读取 TextStream 文件时跳过一行。

语法:

  1. TextStreamObject.SkipLine

实例

  1. <%
  2. dim fs,f,t,x
  3. set fs=Server.CreateObject("Scripting.FileSystemObject")
  4. set f=fs.CreateTextFile("c:\test.txt")
  5. f.writeline("Line 1")
  6. f.writeline("Line 2")
  7. f.writeline("Line 3")
  8. f.close
  9.  
  10. set t=fs.OpenTextFile("c:\test.txt",1,false)
  11. t.SkipLine
  12. x=t.ReadAll
  13. t.close
  14. Response.Write("Output after skipping the first ")
  15. Response.Write(" line in the file: " & x)
  16. %>

输出:

  1. Output after skipping the first line in the file: Line 2
  2. Line 3