2 Replies - 5939 Views - Last Post: 15 February 2010 - 12:34 AM Rate Topic: -----

#1 amh   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-December 09

to get difference of login and logout time in a text box in winforms C

Post icon  Posted 10 December 2009 - 10:40 PM

hi All ,
Please help me out,
how to get difference of user login and logout time and show it in some other textbox?

the thing is login time should automatically load in the textbox when we click on button login and later when we click on button logout at that moment I want current time to be loaded in logout textbox and difference to be displayed in other textbox.....
Is This A Good Question/Topic? 0
  • +

Replies To: to get difference of login and logout time in a text box in winforms C

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5552
  • View blog
  • Posts: 14,558
  • Joined: 18-April 07

Re: to get difference of login and logout time in a text box in winforms C

Posted 10 December 2009 - 11:25 PM

Your answer is right there in the DateTime.Subtract method which is used to subtract one DateTime from another. You can see examples of how to use this at the link below...

DateTime.Subtract Method - MSDN

Record the login time in a variable, when they logout, record that and subtract.

Once you have the difference, you can simply put it in the textbox.

Enjoy! :)
Was This Post Helpful? 1
  • +
  • -

#3 Guest_amh*


Reputation:

Re: to get difference of login and logout time in a text box in winforms C

Posted 15 February 2010 - 12:34 AM

Thanks a lot Martyr.... was out of this D.I.C for long time

View PostMartyr2, on 10 December 2009 - 10:25 PM, said:

Your answer is right there in the DateTime.Subtract method which is used to subtract one DateTime from another. You can see examples of how to use this at the link below...

DateTime.Subtract Method - MSDN

Record the login time in a variable, when they logout, record that and subtract.

Once you have the difference, you can simply put it in the textbox.

Enjoy! :)

Was This Post Helpful? 0

Page 1 of 1