源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

VBS教程:方法-SkipLine 方法

  • 时间:2020-04-01 07:47 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:VBS教程:方法-SkipLine 方法

SkipLine 方法

当读到 [b]TextStream[/b] 文件时,跳过下一行。 [code][i]object.[/i][b]SkipLine[/b][/code] object 应为 TextStream 对象名称。 [h3]说明[/h3]跳过一行意味着读并放弃本行所有字符并包括下一新行字符内容。 如果文件不是以读方式打开则会出现错误。 下面例子举例说明如何使用 [b]SkipLine[/b] 方法:
[code]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 "[/code]嗨,你好[code]!" & vbCrLf & "VB[/code]脚本很有趣[code]!"[/code][code]  Set f = fso.OpenTextFile("c:\testfile.txt", ForReading)[/code][code]  f.SkipLine[/code][code]  SkipLineInFile = f.ReadLine[/code][code]End Function[/code]
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部