使用vbs获取雅虎汇率
网络编程
使用vbs获取雅虎汇率
Function bytes2bstr(vin) strreturn = "" for i = 1 to lenb(vin) thischarcode = ascb(midb(vin,i,1)) if thischarcode < &h80 then strreturn = strreturn & chr(thischarcode) else nextcharcode = ascb(midb(vin,i+1,1)) strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode)) i = i + 1 end if next bytes2bstr = strreturn End Function Function GetURL(url) Set Retrieval = CreateObject("Microsoft.XMLHTTP") With Retrieval .Open "GET", url, False .Send GetURL = bytes2bstr(.responsebody) if len(.responsebody)<2 then strContent = "远程通讯故障!" Call LogToFile(strContent,1) response.end end if End With Set Retrieval = Nothing End Function '========以上为自定义函数======== 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" if s1<>"" and s2<>"" Then huilv = GetURL(url) MsgBox huilv End if
使用vbs删除host文件域址内容
要求:原先host里面已增加以下3行202.102.101.105intranet.corp202.102.101.107mail.intranet.corp202.102.101.108sip.intranet.corp之后不需要此3行内容,所以运行以上vbs代码,来删
VBS实现截图功能
百度说,VBS很难截图,倒是有个利用第三方软件的方法,调用该软件,然后该软件会自动截图。但这样,违背了用VBS的初衷。用VBS就是因为它方便快捷
VBS实现查询服务的制造商
一个网友提问:select*fromwin32_service这个能查服务名称、状态……但我想查这个服务的制造商,如微软、农业银行,还是未知的??这个属性是什么,谢
编辑:一起学习网
标签:代码,货币,截图,请输入,制造商