早教吧 育儿知识 作业答案 考试题库 百科 知识分享

VB怎么将1.txt内容赋值到a(i)并put#1,,a(i)输出内容Open"c:\g.txt"ForBinaryAccessWriteAs#1Fori=0ToList2.ListCount-1openlist2.list(i)ForBinaryAccessWriteAs#2'list2.list(0)=c:\1.txtget#2,,a(i)close#2Put#1,,a(i)NextC

题目详情
VB 怎么将1.txt内容赋值到a(i)并 put #1,,a(i)输出内容
Open "c:\g.txt" For Binary Access Write As #1
For i = 0 To List2.ListCount - 1
open list2.list(i) For Binary Access Write As #2 'list2.list(0)=c:\1.txt
get #2,,a(i)
close #2
Put #1,,a(i)
Next
Close #1
▼优质解答
答案和解析
Dim a() as byte
Open "c:\g.txt" For Binary Access Write As #1
For i = 0 To List2.ListCount - 1
open list2.list(i) For Binary Access Write As #2 'list2.list(0)=c:\1.txt
redim a(lof(2)-1)
get #2,,a()
close #2
Put #1,,a()
Next i
Close #1
这样试试