Friday, April 19, 2013

How To Shut Down Your Computer In C#


Shutdown computer in C#



using System.Diagnostics;
///////////////////////////////////////////
String shutdown;
 
/////////// Start Button //////////////////
Process.Start("Shutdown", shutdown + " -t " + textBox1.Text + @" -c ""Windows is going to shut down!""");
 // -t = time , -c = comments
timer1.Start(); 
label3.Text = textBox1.Text;
  
/////////// Abort Button //////////////////
Process.Start("Shutdown", "-a"); timer1.Stop(); // -a = abort
 
/// ComboBox_SelectedIndexChanged Event ///
switch (comboBox1.SelectedIndex)
{
    case 0: shutdown = "-s"; break; // -s = shutdown
    case 1: shutdown = "-r"; break; // -r = restart
    case 2: shutdown = "-l"; break; // -l = log off
}
 
/////////// Timer_Tick Event //////////////
label3.Text = (Convert.ToInt32(label3.Text) - 1).ToString();



-----------------------------------------
.net - How to shutdown the computer from C#
Shut Down, Restart, Log off or Lock your computer in C#
How To Shut Down Your Computer In C#
Shutdown computer in C#
shut down,restatrt remote computer‎ 
How do I programmatically shutdown the computer?
Remote Shutdown 

IT Certification Category (English)640x480

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Top Online Courses From ProgrammingKnowledge

Python Course http://bit.ly/2vsuMaS
Java Coursehttp://bit.ly/2GEfQMf
Bash Coursehttp://bit.ly/2DBVF0C
Linux Coursehttp://bit.ly/2IXuil0
C Course http://bit.ly/2GQCiD1
C++ Coursehttp://bit.ly/2V4oEVJ
PHP Coursehttp://bit.ly/2XP71WH
Android Coursehttp://bit.ly/2UHih5H
C# Coursehttp://bit.ly/2Vr7HEl
JavaFx Coursehttp://bit.ly/2XMvZWA
NodeJs Coursehttp://bit.ly/2GPg7gA
Jenkins Course http://bit.ly/2Wd4l4W
Scala Coursehttp://bit.ly/2PysyA4
Bootstrap Coursehttp://bit.ly/2DFQ2yC
MongoDB Coursehttp://bit.ly/2LaCJfP
QT C++ GUI Coursehttp://bit.ly/2vwqHSZ