Click here to Skip to main content
15,899,937 members
Home / Discussions / C#
   

C#

 
AnswerRe: c# Pin
Christian Graus25-Aug-07 21:53
protectorChristian Graus25-Aug-07 21:53 
GeneralRe: c# Pin
Paul Conrad26-Aug-07 7:57
professionalPaul Conrad26-Aug-07 7:57 
AnswerRe: c# Pin
Paul Conrad26-Aug-07 7:57
professionalPaul Conrad26-Aug-07 7:57 
Questionjpegtran Wrapper DLL Pin
kuyawsadabaw25-Aug-07 18:29
kuyawsadabaw25-Aug-07 18:29 
AnswerRe: jpegtran Wrapper DLL Pin
Christian Graus25-Aug-07 22:15
protectorChristian Graus25-Aug-07 22:15 
GeneralRe: jpegtran Wrapper DLL Pin
kuyawsadabaw25-Aug-07 22:25
kuyawsadabaw25-Aug-07 22:25 
QuestionPropertyGrid Expand/Collapse Pin
rbuchana25-Aug-07 15:29
rbuchana25-Aug-07 15:29 
QuestionHelp with DLL files Pin
swatgodjr25-Aug-07 12:23
swatgodjr25-Aug-07 12:23 
QuestionDatabase Login Pin
Bonsta25-Aug-07 8:41
Bonsta25-Aug-07 8:41 
AnswerRe: Database Login Pin
Giorgi Dalakishvili25-Aug-07 9:01
mentorGiorgi Dalakishvili25-Aug-07 9:01 
AnswerRe: Database Login Pin
Paul Conrad25-Aug-07 9:24
professionalPaul Conrad25-Aug-07 9:24 
AnswerRe: Database Login Pin
Bonsta26-Aug-07 1:15
Bonsta26-Aug-07 1:15 
GeneralRe: Database Login Pin
Paul Conrad26-Aug-07 8:02
professionalPaul Conrad26-Aug-07 8:02 
QuestionSetup project - Custom Action before the installation starts Pin
Yu Homicide25-Aug-07 8:20
Yu Homicide25-Aug-07 8:20 
AnswerRe: Setup project - Custom Action before the installation starts Pin
ekynox26-Aug-07 1:58
ekynox26-Aug-07 1:58 
QuestionScrollBars in Listview Pin
topksharma198225-Aug-07 7:50
topksharma198225-Aug-07 7:50 
QuestionConsole Menu Application Pin
invalidsyntax101025-Aug-07 7:14
invalidsyntax101025-Aug-07 7:14 
AnswerRe: Console Menu Application Pin
Lutosław25-Aug-07 7:53
Lutosław25-Aug-07 7:53 
GeneralRe: Console Menu Application Pin
invalidsyntax101025-Aug-07 8:52
invalidsyntax101025-Aug-07 8:52 
GeneralRe: Console Menu Application Pin
Lutosław25-Aug-07 9:16
Lutosław25-Aug-07 9:16 
QuestionXML attribute Pin
ytubis25-Aug-07 5:30
ytubis25-Aug-07 5:30 
QuestionTime elapsed since user logged in Pin
Lutosław25-Aug-07 5:25
Lutosław25-Aug-07 5:25 
AnswerRe: Time elapsed since user logged in Pin
Hessam Jalali25-Aug-07 12:16
Hessam Jalali25-Aug-07 12:16 
GeneralRe: Time elapsed since user logged in Pin
Lutosław25-Aug-07 23:21
Lutosław25-Aug-07 23:21 
GeneralRe: Time elapsed since user logged in Pin
Hessam Jalali26-Aug-07 0:26
Hessam Jalali26-Aug-07 0:26 
unfortunately it seems there is no LogOutTime property (at least I didn't found out anyOne)

but AFAIK In windows only on user can work at the same time

so there is a class in .NET name Microsoft.Win32.SystemEvents.SessionEnding it happens when a user trying to logoff or shutdown

so you can find active user through WMI again or through System.Environment.UserName
and find you are in which session.

I think with adding the event to the class you can find total duration.(but it needs your program always run or atleaset when user is going to logout or shutdown)

if you get the duration inside the method associated with that event it would be total user log time.

ofcourse there is another approaches like looking inside eventlogs but i think this is the easiest one

hope the post would be useful

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.