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

 

转载于:https://www.cnblogs.com/greershk/p/7492762.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值