using system.management;
ManagementClass mc_os = new ManagementClass("Win32_OperatingSystem"); mc_os.Scope.Options.EnablePrivileges = true; foreach (ManagementObject mo in mc_os.GetInstances()) { mo.InvokeMethod("Shutdown", null, null); } mc_os.Dispose();
重啟 Reboot
沒有留言:
張貼留言