当前位置: 移动技术网 > IT编程>脚本编程>VBScript > adodb.stream读文件到数组的代码

adodb.stream读文件到数组的代码

2017年12月12日  | 移动技术网IT编程  | 我要评论

物极必反,孙守刚,吉泽章

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)

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网