.Net Remoting - 重新启动服务器并获取重新启动状态

发布于 2024-09-08 10:52:35 字数 382 浏览 1 评论 0原文

我使用 C# 中的 .Net Remoting 在网络上的不同计算机之间设置了客户端服务器。 服务器在计算机开机时启动的服务中运行。

我希望客户端能够重新启动正在运行服务器服务的计算机,并在重新启动成功或失败时接收状态。

最好的方法是什么?

我发现了三种不同的方法来重新启动服务器(如何从 C# 关闭计算机): 1.命令行关闭 2.user32.dll 3. WMI

就获取错误状态而言,哪种重新启动方法更好?我还缺少其他重新启动方法吗?

如何通知客户重启状态?

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狂之美人 2024-09-15 10:52:35

你的服务是windows服务吗?
如果是这样,那么通过检查您的服务是否已启动并正在运行(ping 服务/记录服务 Onstart 方法等),系统重新启动将成功。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文