如何用vb script 读区一个本地的TXT文件里的内容?谢谢~

解决方案 »

  1.   

    VB中读取用:----------------------------------
     Open App.Path + "\" + "Add.dir" For Input As #IntNum
        While Not EOF(IntNum)
            Input #IntNum, Strline
            If Trim(Strline) <> "" Then
               Label1.Caption = Strline
             Else
           End If
        Wend
        Close #IntNum
    -------------------------------------------
      

  2.   

    一次性读取:Dim fPath As String, strRlt As String
    fPath = "c:\test.txt"
    Open fPath For Binary As #1
    strRlt = Space(LOF(1))
    Get 1, 1, strRlt
    Close 1
    MsgBox strRlt
      

  3.   

    在vbs中可以用FSO访问文本文件
      

  4.   

    dim fso
    dim txtfile
    set fso=createobject("scripting.filesystemobject")
    set txtfile=fso.opentxt("c:\www.txt")