如何创建txt文件 [英] How to create txt file

查看:39
本文介绍了如何创建txt文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在 VB6 中创建一个包含一些大内容的 txt 文件.任何人都可以帮我解决这个问题,也请告诉我参考资料.

I have to create a txt file so with some large content in VB6. Can anybody help me out on this and please tell me the references also.

推荐答案

这是如何在 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

来源

这篇关于如何创建txt文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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