Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
いくつかの一般的なサーバー管理タスクを自動化するC#アプリケーションを作成していますが、自動化するタスクの1つは、サーバーのシャットダウンまたは再起動です(他の多くのアプリケーションを特定の順序で停止する必要があるため、そしてそれをするのは苦痛です)。
サーバー上でタスクを呼び出すための最良の方法は何ですか?サーバーとサービスのシャットダウンに対するSAFEアプローチとは何ですか?
shutdown.exeWindowsの 使用。
shutdown.exe
using System.Diagnostics; Process.Start("shutdown","-s -t 10");