Tag Archives: reboot

Make Windows shutdown, reboot, log off, lock, hibernate, and sleep in C#

This example shows how a C# program can make Windows shutdown, reboot, lock, log off, or hibernate. Some of those operations require you to use methods defined in external libraries, so the code uses DllImport attributes to define them. DllImport … Continue reading

Posted in miscellany, system | Tagged , , , , , , , , , , , , , , , , | 1 Comment