vb如何实现输出记事本内容到文本框

比如存在c:\a.txt 我想实现单击按钮就能把这个文件里的内容输入到vb的text1.text上 高手帮忙 谢谢

Private Sub Command1_Click()
open "c:\a.txt" for binary as #1
text1.text=input(lof(1),#1)
close #1
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答  2010-02-16
建一个Command和一个Text,将Text1
的MultiLine设置为True,ScrollBars设置为
3 - Both

Private Sub Command1_Click()
Dim a, b As String
Open "c:\1.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, a
b = b & a & vbCrLf
Loop
Close #1
Text1.Text = b
b = ""
End Sub
相似回答