VB中把外部的TXT文本内容显示在 VB程序中的TEXT文本框里面怎么做的
2个回答
2013-11-29
展开全部
Private Sub Command1_Click()
Text1.Text = ""
Dim st As String
Open "d:\f.txt" For Input As #1
Do While Not (EOF(1))
Line Input #1, st
Text1.Text = Text1.Text & st & Chr(13) & Chr(10)
Loop
Close 1
End Sub
文本框里面是我D盘下面f.txt内容。
Text1.Text = ""
Dim st As String
Open "d:\f.txt" For Input As #1
Do While Not (EOF(1))
Line Input #1, st
Text1.Text = Text1.Text & st & Chr(13) & Chr(10)
Loop
Close 1
End Sub
文本框里面是我D盘下面f.txt内容。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-11-29
展开全部
dim str as string
dim tem as string
Open "文件路径.txt" For Input As #1
Open t For Output As #2
Do
Line Input #1, tem
str=str & vbcrlf & tem
Loop Until EOF(1)
Close
text1.text=str
dim tem as string
Open "文件路径.txt" For Input As #1
Open t For Output As #2
Do
Line Input #1, tem
str=str & vbcrlf & tem
Loop Until EOF(1)
Close
text1.text=str
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询