##The program that your computer writes about the closing of the foundation you want.
Hello friends,
I've written an easy project for users who are starting to code in c #.
To perform this project, the program named visual studio must be installed on your computer.
All you need to do is use the process. Enter the hour and minute you want it to close and continue processing. Your computer will then automatically shut down.
Roads to be used:
Insert button
add timer
interface editing
if else use
shutdown event usage
Button 1 Code:
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "C:\Windows\system32\shutdown.exe";
psi.Arguments = "-f -s -t 0";
Process.Start(psi);
Button 2 Click Code:
textBox1.Enabled = false;
textBox2.Enabled = false;
textBox3.Enabled = false;
timer1.Start();
Timer Code:
string hour, minute, second;
hour = textBox1.Text;
minute = textBox2.Text;
second = textBox3.Text;
My Github Project Picture:
Interface:
Code And Interface:
A suitable example for a beginner coders. I hope you will like it.
Github Project Link: https://github.com/mrdmr/pc_shutdown_app