| View previous topic :: View next topic |
| Author |
Message |
suraj
Joined: 27 Aug 2007 Posts: 145
|
Posted: Mon Jan 11, 2010 6:18 am Post subject: How to Restart our PC using C#.net? |
|
|
Hi,
Can any one explain how to Restart our PC through C#.net in windows application?
Thanks inadvance... |
|
| Back to top |
|
 |
Teena
Joined: 28 Aug 2007 Posts: 138
|
Posted: Mon Jan 11, 2010 9:21 am Post subject: |
|
|
Hi suraj,
We can Restart our PC using c#.net by writing single line of code:
Take one button control & named as Restart.
Write the below single line of code in Restart_click event:
System.Diagnostics.Process.Start("Shutdown", "/r");
Take another button control & named as Shutdown.
Write the below single line of code in Shutdown_click event:
System.Diagnostics.Process.Start("Shutdown", "/s");
Finally build the program & execute.
Thank you. |
|
| Back to top |
|
 |
|