Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: (untagged)
Dear All Senior Programmer,
I created Client program and server program, when the client program is run I can show this client is online, the question What and where write code to know he is offline when shutdown his computer or hibernate it,
thanks and best regards,
Posted
Comments
ridoy 14-Oct-13 10:01am    
language,platform?!
Mohamed Gamal Abdelnasser 14-Oct-13 16:46pm    
C#
Richard MacCutchan 14-Oct-13 10:08am    
Unless the client sends you a message then there is no way to know. All you can tell from the server, is that the connection has closed or is timing out.

1 solution

No way. From the standpoint of the server part, an off-line user does not even exist. In the systems with authentication, you can safely restart the system ("safely" would mean "without any loss or messing up of user-related data") when all users are logged off. For example, you can block logging on for all users and then wait until the last user logs off.

—SA
 
Share this answer
 
Comments
Mohamed Gamal Abdelnasser 14-Oct-13 16:53pm    
My Program created by c# and I want add code in client program when client log off from her computer or hibernate it the program update the client status is offline
thanks
Sergey Alexandrovich Kryukov 14-Oct-13 17:02pm    
And? How is this related to your question (which you already claimed "solved")? Please see my comment to your "Solution 2", which is not a solution.
If you have a question, just ask it. I already answered your original question in full. If you disagree, please explain it.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900