簡體   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