找回密码
 加入
搜索
查看: 2886|回复: 4

[系统综合] 【已解决】如何判断是否是刚开机或重启问题

[复制链接]
发表于 2010-11-1 22:52:17 | 显示全部楼层 |阅读模式
本帖最后由 touch_xu 于 2010-11-6 00:49 编辑

如题:如何判断是否是刚开机或重启问题,如果能判断非法关机,或意外断电更好,谢谢.

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-11-1 23:04:36 | 显示全部楼层
#Include <Date.au3>

Local $iHours, $iMins, $iSecs, $regedit
$aTSB = DllCall("kernel32.dll", "long", "GetTickCount")
If IsArray($aTSB) Then
        $ticksSinceBoot = $aTSB[0]
        _TicksToTime($ticksSinceBoot, $iHours, $iMins, $iSecs)
        $iDays = Int($iHours / 24)
        $iHours = $iHours - ($iDays * 24)
        $nowtime = ($iDays * 24 * 60 * 60) + ($iHours * 60 * 60) + ($iMins * 60) + $iSecs
        If $nowtime < 500 Then
                MsgBox(4096, '刚开机', $nowtime);开机时间小于500秒
        Else
                MsgBox(4096, '', $nowtime/60/60 & ' 小时')
        EndIf
EndIf

评分

参与人数 1金钱 +30 收起 理由
afan + 30

查看全部评分

发表于 2010-11-2 11:49:33 | 显示全部楼层
这个能行吗?
 楼主| 发表于 2010-11-6 00:49:17 | 显示全部楼层
谢谢,这个可以的
发表于 2011-9-17 03:32:04 | 显示全部楼层
我看行。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 04:04 , Processed in 0.094488 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表