au3查看股票价格
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了au3查看股票价格相关的知识,希望对你有一定的参考价值。
这次用GUI窗口实现股票查询和显示。
#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FontConstants.au3> mainrun() Func mainrun() GUICreate("股票信息", 600, 600) Local Const $sFont = "Arial" Local $idMyedit = GUICtrlCreateEdit("Info" & @CRLF, 0, 0, 600, 600, 0) GUICtrlSetFont($idMyedit, 36, $FW_NORMAL, $sFont) ; GUISetState(@SW_SHOW) Send("{END}") While 1 Local $html = BinaryToString(InetRead(‘http://hq.sinajs.cn/list=sh600000‘)) $aArray = StringSplit($HTML, ‘,‘) If(UBound($aArray) < 2) Then ContinueLoop EndIf $gname = StringSplit($aArray[1], ‘"‘) $diff = Round($aArray[4] - $aArray[3], 2) $diffpercentage = Round($diff / $aArray[3] * 100, 3) $show1 = $gname[2] & @CRLF &‘现价: ‘ & $aArray[4] & @CRLF &‘涨跌幅: ‘ & $diff & @CRLF &‘涨跌%: ‘ & $diffpercentage & @CRLF $show2 = ‘最高: ‘ & $aArray[5] & @CRLF $show3 = ‘最低: ‘ & $aArray[6] & @CRLF $show4 = ‘今开: ‘ & $aArray[2] & @CRLF $show5 = ‘昨收: ‘ & $aArray[3] & @CRLF $showtime = $aArray[31] &‘ ‘&$aArray[32] & @CRLF GUICtrlSetData($idMyedit, $show1) GUICtrlSetData($idMyedit, $show2, 1) GUICtrlSetData($idMyedit, $show3, 1) GUICtrlSetData($idMyedit, $show4, 1) GUICtrlSetData($idMyedit, $show5, 1) GUICtrlSetData($idMyedit, $showtime, 1) Sleep(3000) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd GUIDelete() EndFunc
以上是关于au3查看股票价格的主要内容,如果未能解决你的问题,请参考以下文章