繁体   English   中英

在C#中使用shutdown.exe关闭另一个系统?

[英]Shutdown another System using shutdown.exe in C#?

我使用以下代码关闭自己的System.It工作正常。我需要关闭另一个系统,它连接在LAN连接 我无法使用此代码执行此操作。 如何使用shutdown.exe关闭另一个系统? 我的操作系统是windows7。

using System.Diagnostics;


        protected void Button1_Click(object sender, EventArgs e)
        {
            Process.Start("shutdown.exe", "-s -t 00");

        }

菜单开始 - >运行 - >键入cmd->按enter键

在cmd类型

shutdown /?

你可以看到帮助,根据帮助你需要的钥匙

   /m \\computer Specify the target computer.

只是为了完整性:

Process.Start("shutdown.exe", "-s -t 00 \\computer");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM