使用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 入住酒店文案祝福语简短