Dim K As New FileSystemObject, L As TextStream
Set L = K.OpenTextFile("C:\WINDOWS\upgrade.txt")
Do Until L.AtEndOfStream
L.SkipLine
Loop
MsgBox L.Line-1
dim stra as string,al as long
open "..." for input as #1
al=1
while not eof(1)
line input #1,stra '?line input stra,#1
al=al+1
wend
stra=""
close #1
al为行数
dim mbyte() as byte
dim mlen as long
dim filename as string
filename="c:\test.txt"
mlen=filelen(filename)
redim mbyte(mlen-1)
open filename for binary as #1
get #1,,mbyte
close #1
dim s as string
s=strconv(mbyte,vbunicode)
dim arr
arr=split(s,vbcrlf)
'文件行数为mline+1
dim mline as long
mline=ubound(arr)
'第n行的内容为,arr(n-1)
dim linestr as string
linestr=arr(5)