ODD One out Quiz

Friday, 28 March 2014

C# Code Examples

Code to Shutdown your computer in button click event in C#

Process.Start("shutdown", "/s /t 0"); //to shut down the computer


Code to open the desktop in C# is written below :- 

You have to write one line of code in button_click event

{
System.Diagnostics.Process.Start("explorer", Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
}

No comments:

Post a Comment