示例#1
0
 public static void PreventSystemFromSleeping()
 {
     try
     {
         fPreviousExecutionState = WindowsNativeMethods.SetThreadExecutionState(WindowsNativeMethods.EXECUTION_STATE.ES_CONTINUOUS | WindowsNativeMethods.EXECUTION_STATE.ES_AWAYMODE_REQUIRED | WindowsNativeMethods.EXECUTION_STATE.ES_SYSTEM_REQUIRED);
     }
     catch (DllNotFoundException dnte)
     {
     }
     catch (EntryPointNotFoundException enfe)
     {
     }
 }
示例#2
0
 public static void PreventSystemFromSleeping()
 {
     try
     {
         fPreviousExecutionState = WindowsNativeMethods.SetThreadExecutionState(WindowsNativeMethods.EXECUTION_STATE.ES_CONTINUOUS | WindowsNativeMethods.EXECUTION_STATE.ES_AWAYMODE_REQUIRED | WindowsNativeMethods.EXECUTION_STATE.ES_SYSTEM_REQUIRED);
     }
     catch (DllNotFoundException dnte)
     {
     }
     catch (EntryPointNotFoundException enfe)
     {
     }
 }