怎样用line input把记事本中的两个数字在两个文本框中显示出来?

来源:百度知道 编辑:UC知道 时间:2024/05/08 10:25:26
怎样用line input把记事本中的两个数字在两个文本框中显示出来?
如:Open "c:\1.txt" For Output As #1
Print #1, Text1.Text
Print #1, Text2.Text
清空 Text1Text2 后再把文本中的数显示出来
我是指用
Open "c:\CSZ.txt" For Input As #1
Line Input #1,
的方法把两个text的内容还原回去

如果第一样是text1的数据第二行是text2的数据的话就这样
dim i%,data$
Open "c:\CSZ.txt" For Input As #1
do until i=2
i=i+1
line input #1,data
if i=1 then text1=data
if i=2 then text2=data
loop
close #1

定义2个变量
dim a,b
Open "c:\1.txt" For Output As #1
Print #1, Text1.Text
Print #1, Text2.Text
a=Text1.Text
b=Text2.Text
Text1.Text=""
Text2.Text=""
Text1.Text =a
Text2.Text =b

Dim StrReadFile as string
Open "c:\1.txt" For Output As #1
Print #1, Text1.Text
Print #1, Text2.Text
Close #1
Text1.Text = ""
Text2.Text = ""
Open "c:\1.txt" For Input As #1
Line input #1, StrReadFile
Text1.text = StrReadFile
Line input #1, StrReadFile
Text2.text = StrReadFile
Close #1