Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I need to have some application in C# that can detect shutdown of any system on LAN. If two computers are connected through LAN, how is it possible in C# for one computer to identify that the other system has been shutdown. OR how can one computer notify other that it is shutting down
Thanks

What I have tried:

Well I had tried TCP IP but there is no requirement in this regard.
Posted
Updated 6-Aug-18 23:29pm

1 solution

I don't know if there is a more sophisticated way to do it...

but a possibility could be to use a regular ping
If the LAN partner is there, there is an answer if not a timeout.

You won't be able to know if the computer was switched down or the LAN cable was unplugged, but it is a start.


If it is really needed to know when shutdown is, then you can created an tiny application or service that run in the background:
1) The app/service listens the TCP input
2) the app/service sends a broadcast TCP Telegram or a concrete telegram to the given partner when exiting if windows is shutdown

But you won't have a signal if the shutdown is a hard one (e.g. black out)
 
Share this answer
 

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