利用下面的程序从一个文件中向Text框中输入文字,怎么也换不了行,向各位大虾请教!
Open "d:\VB.txt" For Input As #1
While Not EOF(1)
Line Input #1, line
Text1 = Text1 + line + Chr(13) + Chr(10)
Wend
Close #1
Open "d:\VB.txt" For Input As #1
While Not EOF(1)
Line Input #1, line
Text1 = Text1 + line + Chr(13) + Chr(10)
Wend
Close #1
'***********
Text1.MultiLine =true
'************
While Not EOF(1)
Line Input #1, line
Text1 = Text1 + line + Chr(13) + Chr(10)
Wend
Close #1
dim fNum as integer
dim strTemp as string
fNum=freefile
open "d:\VB.txt" for binary as #fNum
strTemp=String(" ",lof(fNum)) '得到和文件长度一样长的字符串
Get #fNum,strTemp '一次读取整个文件
Text1.MultiLine =true
Text1=strTemp
close #fNum
主要是一行行读取的速度太慢了!
While Not EOF(1)
Line Input #1, line
Text1 = Text1 + line + vbcrlf '比chr(13)+chr(10)方便多了
Wend
Close #1
While Not EOF(1)
Line Input #1, line
Text1 = "我是一个中国人" + line +“操他妈的日本人”+ vbcrlf '比chr(13)+chr(10)方便多了
Wend
Close #1