您现在的位置是:网站首页> 编程资料编程资料
adodb.stream读文件到数组的代码_vbs_
2023-05-25
290人已围观
简介 adodb.stream读文件到数组的代码_vbs_
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)
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)
您可能感兴趣的文章:
上一篇:vbs的sort排序_vbs_
