How to put your PC in sleep or hibernate via C#
I thought that is impossible to put your PC in sleep or hibernate via C#. I found that is incorrect! Moreover, that is very simple too, just one line of command.
Putting the PC in sleep mode
Code
Application.SetSuspendState(PowerState.Suspend, false, false); |
Putting the PC in Hibernate mode
Code
Application.SetSuspendState(PowerState.Hibernate, false, false); |
That is so simple!!!
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 91 feedbacks awaiting moderation...
Form is loading...