VB怎么读取一个TXT文件然后赋值在变量上?
2个回答
展开全部
Dim str As String
Dim TEM As String
Open "C:\Documents and Settings\Administrator\桌面\1.TXT" For Input As 1
Do Until EOF(1)
Line Input #1, TEM
str = str + TEM
Loop
Close #1
其中line input是读取一行的数据,这个函数比较重要,以上代码以及运行过了,呵呵
Dim TEM As String
Open "C:\Documents and Settings\Administrator\桌面\1.TXT" For Input As 1
Do Until EOF(1)
Line Input #1, TEM
str = str + TEM
Loop
Close #1
其中line input是读取一行的数据,这个函数比较重要,以上代码以及运行过了,呵呵
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2015-06-26
展开全部
Dim str As String
Dim TEM As String
Open "C:\Documents and Settings\Administrator\桌面\1.TXT" For Input As 1
Do Until EOF(1)
Line Input #1, TEM
str = str + TEM
Loop
Close #1
其中line input是读取一行的数据,这个函数比较重要,以上代码以及运行过了。
Dim TEM As String
Open "C:\Documents and Settings\Administrator\桌面\1.TXT" For Input As 1
Do Until EOF(1)
Line Input #1, TEM
str = str + TEM
Loop
Close #1
其中line input是读取一行的数据,这个函数比较重要,以上代码以及运行过了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询