比如说你的网页保存为 a.html 以下vbs实现将指定值读出并显示:
set fso=createobject("scripting.filesystemobject")
set file=fso.opentextfile("a.html")'a.html
为网页保存的绝对路径
do while file.atendofstream=false
line=file.readline
select case true
case instr(1,line,"现金")<>0
get_code line,num
a="现金: "&num&vbcrlf
case instr(1,line,"生命")<>0
get_code line,num
b="生命: "&num&vbcrlf
case instr(1,line,"精力")<>0
get_code line,num
c="精力: "&num&vbcrlf
case instr(1,line,"体力")<>0
get_code line,num
d="体力: "&num&vbcrlf
case instr(1,line,"经验")<>0
get_code line,num
e="经验: "&num&vbcrlf
case instr(1,line,"级别")<>0
get_code line,num
f="级别: "&num&vbcrlf
end select
loop
file.close
msgbox a&b&c&d&e&f,4096+64,"温馨提示"
private sub get_code(line,num)
s1=instr(1,line,":")
s2=instr(1,line,"
")num=mid(line, s1+ 9 ,s2 - s1- 9)
end sub
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试