How To Get Windows Uptime | |||
| |||
function UpTime: string; const ticksperday : integer = 1000 * 60 * 60 * 24; ticksperhour : integer = 1000 * 60 * 60; ticksperminute : integer = 1000 * 60; tickspersecond : integer = 1000; var t : longword; d, h, m, s : integer; begin t := GetTickCount; d := t div ticksperday; dec(t, d * ticksperday); h := t div ticksperhour; dec(t, h * ticksperhour); m := t div ticksperminute; dec(t, m * ticksperminute); s := t div tickspersecond; Result := 'Uptime: '+IntToStr(d)+ ' Days '+IntToStr(h)+' Hours '+IntToStr(m)+' Minutes '+IntToStr(s)+' Seconds'; end; procedure TForm1.Button1Click(Sender: TObject); begin label1.Caption:=UpTime; end; This is useful function for making remote management application that have to check system status frequently. I used this function to reboot at certain condition such as Uptime. Tags: Delphi PC 켜져 있는 시간 알아내는 방법 Remote Management TickCount Uptime 켜져있는시간 | |||
| |||
| |||
Login for comment |