title: How can I prevent Windows OS from entering Sleep mode - .Net
body: <p>Using C#, how can I prevent Windows OS from entering Sleep mode?</p>
  
  <p>I know, that I can turn Sleep Mode off, that is what I do now. This question is about preventing the OS from Sleeping while a program is in a long running operation. Afterwards, entering Sleep mode shall be re-enabled again.</p>