如何使用 VB6 从文本文件中读取数据? [英] How can I read data from a text file using VB6?

查看:17
本文介绍了如何使用 VB6 从文本文件中读取数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从文本文件中读取数据并在我的应用程序中使用相同的数据.我使用 VB 6.0.我使用什么命令?一些示例代码将不胜感激.

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.

推荐答案

以下是如何将整个文本文件读入字符串 - 来自 VB6 手册.

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

这篇关于如何使用 VB6 从文本文件中读取数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆