Tuesday, May 5, 2015

When Processing large data , my computer becomes idle and c# console application also gets halted.

so kindly help me , not to go away my pc into idle mode, via programatically or via pc Settings.

Via PC settings, simply set your power settings via the control panel and choose an "always on" profile.

In code.  Loosely:

void main()
{
   SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_AWAYMODE_REQUIRED);
   DoEverything();
   SetThreadExecutionState(ES_CONTINUOUS);
}

No comments:

Post a Comment