c# - 从 C# 显示关闭对话框

标签 c# windows-8 system-shutdown

有没有办法在 C# 中显示 Windows 关机对话框?

Shutdown dialog box

我找到了一个可以与 System.Diagnostic.Process.Start 一起使用的命令

taskkill /im explorer.exe

但不适用于 Windows 8

最佳答案

你可以使用 shutdown.exe而不是试图杀死探险家。:

shutdown.exe /i /t 0

关于c# - 从 C# 显示关闭对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12041592/

相关文章:

C# 命名空间问题

c# - 使用 linq 的 WPF 组合框绑定(bind)

c# - 坚持使用 Delphi.NET 和 Delphi 2007

linux - 检测挂起的 linux 关闭

使用 Contains 方法检查 List<float> 中的 float 时的 C# 准确性

c# - Azure 存储 Blob Rest Api header

internet-explorer - Windows Phone 8 模拟器互联网连接

c# - 在 Windows 8.1 中隐藏/禁用开始按钮

c# - 如何在用户注销或关闭 Windows 时延迟关闭应用程序?

linux - Arch Linux/systemd - 防止任何类型的关机/重启