vb 读取txt到text

我请求 一个方法 如何把 txt文本文档的内容 读取到 vb的text框上,txt是万国码的。用vb6.0编写可以吗? 如果可以 能否列代码? 我的基础书什麽都没有讲到。

第1个回答  2011-09-12
dim txt as string
open "c:\temp.txt" for input as #1 '文件路径自己改
do while not eof(1)
line input #1,txt
text1.text=text1.text & txt & vbcrlf
loop
close #1追问

不能导入(unicode)啊,你有没有做过实验 才发表的?

第2个回答  2011-09-11
Private Sub Command1_Click()
Dim str
Open App.Path & "\1.txt" For Input As #1
str = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
Text1 = str
End Sub
第3个回答  2011-09-12
不可以。
相似回答