VB 怎样实现读取文件当前最后一行,并取出能容及当前行数。文件信息量很大不易逐行读取。 10
3个回答
展开全部
额,做了几个还是按行比较快。。。 你找到好方法别忘了贴出来啊。
Private Sub Command1_Click()
Dim a As Long
Dim a As Long, Str As String
Open "D:\123.txt" For Input As #1
While Not EOF(1)
Line Input #1, Str
a = a + 1
Wend
Close #1
MsgBox "行数: " & a & vbCrLf & "最后一行为: " & Str
End Sub
Private Sub Command1_Click()
Dim a As Long
Dim a As Long, Str As String
Open "D:\123.txt" For Input As #1
While Not EOF(1)
Line Input #1, Str
a = a + 1
Wend
Close #1
MsgBox "行数: " & a & vbCrLf & "最后一行为: " & Str
End Sub
展开全部
文件?txt?
Dim a As String
Open "C:\Documents and Settings\Administrator\桌面\vb6.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, linestr
a = linestr
Loop
Close #1
MsgBox a'a为最后一行文本内容
Dim a As String
Open "C:\Documents and Settings\Administrator\桌面\vb6.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, linestr
a = linestr
Loop
Close #1
MsgBox a'a为最后一行文本内容
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
留个邮箱,给你个例子
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询