vb中怎样读出TXT文件中的内容,并将读出来的内容放在数组中?求高手写出程序,谢谢 10
1个回答
展开全部
放你总会吧,下面是读
Private Sub open()
Dim thefile as string
On Error Goto FE
If (Right(dirLook.Path,1)="\") then
TheFile=dirLook.Path+filFind.FileName
Else
TheFile=dirLook.Path+"\"+filFind.FileName
End if
Open thefile for input as #1
TEXTBOX1.text=Input(LOF(1),#1)
Close #1
Exit Sub
FE:
MsgBox"ERR"
Resume Next
End Sub
'dirLook指路径,filFind.filFind指文件名,dirlook最先为盘名
Private Sub open()
Dim thefile as string
On Error Goto FE
If (Right(dirLook.Path,1)="\") then
TheFile=dirLook.Path+filFind.FileName
Else
TheFile=dirLook.Path+"\"+filFind.FileName
End if
Open thefile for input as #1
TEXTBOX1.text=Input(LOF(1),#1)
Close #1
Exit Sub
FE:
MsgBox"ERR"
Resume Next
End Sub
'dirLook指路径,filFind.filFind指文件名,dirlook最先为盘名
追问
这个TXT文件里的字符串如下:0,16,"ICS18LN12PCM1-FB",36,M12,L,N,120,10,132,P,C,3,30,5110309_A1,P005,T109,Y,Y,Y,N,N,N,70,15,400,350,30,5,"E8034","E8035","ETprova1.txt"。请问有引号的字符串改怎样赋值给变量?文件读完后再分离出来赋值给数组?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询