AU3如何读取系统运行了多长时间?
本帖最后由 l4ever 于 2009-6-10 18:00 编辑求教?谢谢... $time = DllCall("kernel32.dll","int","GetTickCount")
MsgBox(0,0,'系统已经运行了'&$time/60000&'分钟') $time = DllCall("kernel32.dll","int","GetTickCount")
MsgBox(0,0,'系统已经运行了'&$time/60000&'分钟')
lynfr8 发表于 2009-6-10 17:12 http://www.autoitx.com/images/common/back.gif
不错,能否读取到系统启动的时间呢? 再给两个完整一点的例子吧$milliseconds = TimerDiff(0)
$years = Int($milliseconds / 31536000000)
$remainMS = Mod($milliseconds, 31536000000)
$days = Int($remainMS / 86400000)
$remainMS = Mod($milliseconds, 86400000)
$hours = Int($remainMS / 3600000)
$remainMS = Mod($milliseconds, 3600000)
$minutes = Int($remainMS / 60000)
$remainMS = Mod($milliseconds, 60000)
$seconds = Int($remainMS / 1000)
$remainMS = Mod($milliseconds, 1000)
MsgBox(0,"系统启动时间:",$years &"年" & $days& "天" &$hours& "小时" &$minutes & "分 " &$seconds & "秒" & Int($remainMS) & "毫秒" )#Include <Date.au3>
$aTSB = DllCall ("kernel32.dll", "long", "GetTickCount")
$ticksSinceBoot = $aTSB
dim $iHours, $iMins, $iSecs
_TicksToTime ( $ticksSinceBoot, $iHours, $iMins, $iSecs )
$iDays = int($iHours / 24)
$iHours = $iHours - ($iDays * 24)
msgbox(0,"系统启动时间:",$iDays&"天"&$iHours& "小时 "& $iMins &"分"& $iSecs&" 秒 " )
Sanhen 写的
至于启动时间,你获取系统时间再减去已启动的时间不就是开机时间了吗? OK.感谢楼上的朋友 太强大了!:face (30):
什么时候才达到这种境界啊!
什么时候才能熟练的调用dll啊! 快了快了,, 学习下。。。。
页:
[1]