using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; [DllImport("advapi32.dll",EntryPoint="InitiateSyste mShutdown")] public static extern bool InitiateSystemShutdownA(string lpMachineName, string lpMessage, int dwTimeout, int bForceAppsClosed, int bRebootAfterShutdown); private void button1_Click(object sender, System.EventArgs e) { InitiateSystemShutdownA(null,null, 30, 1, 1); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)