try { if (MessageBox.Show("Are you sure you want to restart your computer?", "Restart", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { ShutDownWindows("2"); // Restart the computer } } catch (Exception ex) { MessageBox.Show(ex.Message); }
Thread.Sleep (TimeSpan.FromHours (1)); // sleep for 1 hour Thread.Sleep (500); // sleep for 500 milliseconds
Process.Start("path to your program .exe");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)