使用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
热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短