Introduction
Simple idea , This tip to how shut down and restart your PC .
Background
This tip is based on a System32 Files whose address is Windows\System32\Shutdown.exe
Using the code
So for doing what we want, we must follow the steps given below ;
1- Create New Project With C#
2- make your desing of Program , You Need Add two buttons on form .
3- Use This code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
namespace Shutdown_PC
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnShutdown_Click(object sender, EventArgs e)
{
Process.Start("shutdown.exe", "/s /t 00 /f");
}
private void btnRestart_Click(object sender, EventArgs e)
{
Process.Start("shutdown.exe", "/r /t 00 /f");
}
}
}
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.