[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Read logoff and logon times for windows with delphi

Posted on 2008-01-28
8
Medium Priority
?
1,197 Views
Last Modified: 2012-05-05
Where do I find the log file which logs windows xp lonon and logoff times.
How can I read the file using delphi code
0
Comment
Question by:hush021299
  • 4
  • 3
8 Comments
 
LVL 1

Author Comment

by:hush021299
ID: 20758783
Changed failure in the head line
0
 
LVL 21

Expert Comment

by:ziolko
ID: 20758962
you can find it in system log (Security).
with delphi you can do this with:
OpenEventLog() and ReadEventLog() functions.

If there will be no one with ready code I'll post some here later this evening.

ziolko.
0
 
LVL 21

Accepted Solution

by:
ziolko earned 750 total points
ID: 20759261
check out inthe's solution:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20095952.html

just change 'Application' to 'Security' you will also have to browse for logon/logoff event log entries

ziolko.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 5

Expert Comment

by:Steven-Fernandez
ID: 20760817
Or a simple idea.

Create a small application that will start on windows startup (for example: put a shortcut in the start menu to start it automatically or via the registry).

The application can start and minimize to the try.

Everytime the application starts save the date and time on a file on a specified location of your choice.

Then inside a timer you can try something like this to detect windows shutdown:

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_10305197.html?sfQueryTermInfo=1+detect+shutdown

When detected that add this entry date and time to your file.

This is a very simple way to do it and you will have a log of all logins and shutdowns and you can even add the username to the log.  

0
 
LVL 1

Author Comment

by:hush021299
ID: 20849606
Thanks I will check that.
The Idea from Stecenz is already implemented in an old program of mine: WinExit
But often the shutdown is "incontroled", sometimes I start with hibernated machine
so I search for windows log
0
 
LVL 1

Author Comment

by:hush021299
ID: 20849623
I failed early
in windows/security/log there is no system.log
0
 
LVL 21

Expert Comment

by:ziolko
ID: 20850469
>>in windows/security/log there is no system.log

nope there's no system.log but there is \Windows\System32\config\SecEvent.evt

but you won't be anle to read directly form file use inthe's solution from link I posted to read from system log not from file on disk

ziolko.
0
 
LVL 1

Author Closing Comment

by:hush021299
ID: 31425603
I will try this one
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question