逐行读取txt

Dim fso, f1, ts, s
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("e:\serverlist.txt", ForReading)
'ts.skipline '跳过一行
do until ts.AtEndOfStream '判断是否到文件末尾

tsline = ts.readline
'tslines = split(tsline,",") '使用,分隔字符串
'ip = tslines(0) '分隔后的第一个字符串
'username = tslines(1)
'userpass = tslines(2)

msgbox tsline
loop
ts.close

posted on 2014-09-18 21:00  momingliu11  阅读(340)  评论(0编辑  收藏  举报