加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

vb6 – 如何创建txt文件

发布时间:2020-12-17 07:27:04 所属栏目:百科 来源:网络整理
导读:我必须创建一个txt文件,以便在VB6中使用一些大内容.任何人都可以帮我解决这个问题,请告诉我参考资料. 解决方法 这是您在VB6中创建文本文件的方法 Dim iFileNo as IntegeriFileNo = FreeFile'open the file for writingOpen "C:Test.txt" For Output As #iFi
我必须创建一个txt文件,以便在VB6中使用一些大内容.任何人都可以帮我解决这个问题,请告诉我参考资料.

解决方法

这是您在VB6中创建文本文件的方法

Dim iFileNo as Integer
iFileNo = FreeFile
'open the file for writing
Open "C:Test.txt" For Output As #iFileNo
'please note,if this file already exists it will be overwritten!

'write some example text to the file
Print #iFileNo,"first line of text"
Print #iFileNo," second line of text"
Print #iFileNo,"" 'blank line
Print #iFileNo,"some more text!"

'close the file (if you dont do this,you wont be able to open it again!)
Close #iFileNo

Source

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读