vbs读取整个文本文件并输出

Const ForReading = 1
Dim message

Dim fs, ts
set fs = CreateObject("Scripting.FileSystemObject")
set ts = fs.OpenTextFile("1.txt", ForReading)
Do Until ts.AtEndOfStream
    message = ts.ReadLine       '即使是空行,也会被读一次
    if message <> "" Then
        MsgBox message
    End if
Loop
ts.Close
set ts = Nothing
set fs = Nothing

posted on 2011-02-26 22:10  清清飞扬  阅读(7747)  评论(0)    收藏  举报