Shutdown My Computer Programmatically in C#?
It is possible to use the .NET Process class to shutdown the computer. This is done by calling its Start() method with the arguments outlined below.
System.Diagnostic.Process.Start("shutdown.exe", "-s -f -t 00");
Addional information on how to use .NET Process class can be found at MSDN or by following the link below.
Process Class Documentation
System.Diagnostic.Process.Start("shutdown.exe", "-s -f -t 00");
Addional information on how to use .NET Process class can be found at MSDN or by following the link below.
Process Class Documentation
4 Comments:
Thanks, this was a useful little tidbit.
Thanks Jessn , thanks. Code is working
Thanks man... ;)
This might be useful too... It illustrates how to lock the computer programatically.
http://jessn.blogspot.com/2009/05/lock-my-computer-programatically-in-c.html
Post a Comment
<< Home