用什么代码让VB显示新建文本文档.TXT里面的东西?

来源:百度知道 编辑:UC知道 时间:2024/06/08 22:54:50
汉字

Dim txt As String, cl As String, FileName As String
FileName="文本的路径和名称"
Open FileName For Input As #1
Do While Not EOF(1)
If Not txt = "" Then txt = txt & vbCrLf
Line Input #1, cl
txt = txt & cl
Loop
Close #1
(这个是你要显示的文本框)Text1.Text = txt

Open App.Path & "\aa.txt" For Input As #1
s = Input(LOF(1), #1)
Close #1
或者用FSO对象。。