adodb.stream读文件到数组的代码
adodb.stream读文件到数组的代码
发布时间:2016-12-28 来源:查字典编辑
摘要:Functionfilenum(filename,i)Dimst,sSetst=CreateObject("ADODB.Stream")st...

Functionfilenum(filename,i)

Dimst,s

Setst=CreateObject("ADODB.Stream")

st.Type=2'流类型为文本

st.Mode=3'模式为读写

st.Open

st.LineSeparator=13

st.LoadFromFilefilename

DoWhileNotSt.EOS

s=Split(st.readtext(),vbCrLf)

Loop

'MsgBoxUBound(s)total

filenum=s(i)

st.Close

Endfunction

MsgBoxfilenum("file.txt",2)

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新vbs学习
热门vbs学习
脚本专栏子分类