I have a client server set up between different computers on a 开发者_运维百科network using .Net Remoting in C#. The server runs in a service that starts up when the computer turns on.
I want the client to be able to restart the computer that is running the server service and receive a status if the restart succeeded or failed.
What is the best approach?
I found three different ways to reboot the server (How to shut down the computer from C#) : 1. command line shut down 2. user32.dll 3. WMI
Which Reboot method is better as far as getting Error statuses? Are there any other reboot methods I'm missing?
How Can I notify the Client about the reboot status?
Thanks
Is your service a windows service? If so, then by checking if your service is up and running (ping the service / log the service Onstart method etc), the system reboot would have been successful.
精彩评论