7,764
社区成员
发帖
与我相关
我的任务
分享
dim dict as dictionary
dim fso as filesystemobject
dim stream as textstream
set stream = fso.opentextfile("c:\temp.txt",forreading)
dim content as string
content = stream.readall()
dim arr() as string
arr = split(content,vbcrlf)
dim i as long
for i=lbound(arr) to ubound(arr)
dim temp() as string
temp = split(arr(i),"=")
call dict.add(temp(0),temp(1))
next
dim s as string
dim h as long
'将文本内容读入变量s
h=freefile
open "c:\temp.txt" for binary as h
s=space(lof(h))
get h,,s
close
'然后可以按上面yarui0301的方法处理
'不过最好加个判断
dim i as long
dim a() as string
a=split(s,"=")
for i=0 to ubound(a)
if trim(a(i))<>"" then a(i)=val(a(i))
next