Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\testfile.txt", True)
a.WriteLine("This is a test.")
a.Readline
a.Close

解决方案 »

  1.   

    Line Input # 语句
          从已打开的顺序文件中读出一行并将它分配给 String变量。语法Line Input #filenumber, varnameLine Input # 语句的语法具有以下几个部分:部分 描述 
    filenumber 必要。任何有效的文件号。 
    varname 必要。有效的 Variant 或 String 变量名。 
    说明通常用 Print # 将 Line Input # 语句读出的数据从文件中写出来。Line Input # 语句一次只从文件中读出一个字符,直到遇到回车符 (Chr(13)) 或回车–换行符 (Chr(13) + Chr(10)) 为止。回车–换行符将被跳过,而不会被附加到字符串上。
      

  2.   

    to:twinking() 
    ReadLine 是 "方法"  楼主要的是个函数
      

  3.   

    Dim aaa As FileSystemObject
          Dim FileName As String
          Dim nextline As String '一行文本内容
          Dim fnum As Integer
          FileName= "d:\sst\aaa.txt"
          If aaa.FileExists(FileName) Then
             fnum = FreeFile()
             Open FileName For Input As #fnum   ' 打开输出文件。
             While EOF(fnum) = False
              Line Input #fnum, nextline
              MsgBox nextline
             Wend
          End If