使用vbs获取雅虎汇率
使用vbs获取雅虎汇率
Functionbytes2bstr(vin)
strreturn=""
fori=1tolenb(vin)
thischarcode=ascb(midb(vin,i,1))
ifthischarcode<&h80then
strreturn=strreturn&chr(thischarcode)
else
nextcharcode=ascb(midb(vin,i+1,1))
strreturn=strreturn&chr(clng(thischarcode)*&h100+cint(nextcharcode))
i=i+1
endif
next
bytes2bstr=strreturn
EndFunction
FunctionGetURL(url)
SetRetrieval=CreateObject("Microsoft.XMLHTTP")
WithRetrieval
.Open"GET",url,False
.Send
GetURL=bytes2bstr(.responsebody)
iflen(.responsebody)<2then
strContent="远程通讯故障!"
CallLogToFile(strContent,1)
response.end
endif
EndWith
SetRetrieval=Nothing
EndFunction
'========以上为自定义函数========
s1=INPUTBOX("原始货币代码:","请输入原始货币代码","USD")
s2=INPUTBOX("目标货币代码:","请输入目标货币代码","CNY")
s=s1&s2
url="http://download.finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s="&s&"=x"
ifs1<>""ands2<>""Then
huilv=GetURL(url)
MsgBoxhuilv
Endif
热门推荐
10 八一幼儿祝福语大全简短
11 公司乔迁食堂祝福语简短
12 婚礼结束聚餐祝福语简短
13 儿媳买车妈妈祝福语简短
14 毕业送礼老师祝福语简短
15 同事辞职正常祝福语简短
16 恭贺新婚文案祝福语简短
17 金店立秋祝福语简短英文
18 婆婆高寿祝福语大全简短