How can I read data from a text file using VB6?

前端 未结 7 1639
悲哀的现实
悲哀的现实 2020-12-06 07:22

I need to read data from text files and use the same in my application. Im using VB 6.0. What commands do I use? Some Sample code would be highly appreciated.

相关标签:
7条回答
  • 2020-12-06 08:09

    Here's how to read an entire text file into a string - from the VB6 manual.

    Function FileToString(strFilename As String) As String
      iFile = FreeFile
      Open strFilename For Input As #iFile
        FileToString = StrConv(InputB(LOF(iFile), iFile), vbUnicode)
      Close #iFile
    End Function
    
    0 讨论(0)
提交回复
热议问题