AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

Logging use of Windows

A little while ago, I needed to log the times the my PC was being switched on and off, so I wrote this little program. Basically, it can sit in your StartUp folder on the Start Menu, so it is run when you start Windows. It hides itself away, and writes the time to a log file. This program thien remains running the entire session, until Windows is shut down, at which point, it writes the 'Off' time to the log.

Private Sub Form_Load()
Left = -10000
Top = -10000
Open "c:\apps\log.txt" For Append As #1
Print #1, "On: " & CStr(Now)
Close #1
End Sub

Private Sub Form_Unload(Cancel As Integer)
Open "c:\apps\log.txt" For Append As #1
Print #1, "Off:" & CStr(Now)
Close #1
End
End Sub

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/