Function filenum(filename,i)
Dim st,s 
Set st= CreateObject("ADODB.Stream")
st.Type = 2 '流类型为文本
st.Mode = 3 '模式为读写
st.Open
st.LineSeparator=13 
st.LoadFromFile filename
Do While Not St.EOS 
s = Split(st.readtext(), vbCrLf)   
Loop 
'MsgBox UBound(s) total
filenum=s(i)
st.Close
End function


MsgBox filenum("file.txt",2)

以上就是【adodb.stream读文件到数组的代码】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)
发表我的评论

最新评论

  1. 暂无评论