Exemplo n.º 1
0
 private static void DoKeepAlive()
 {
     try
     {
         // Inform the local system we need it.
         SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED);
         // Tell the server we need it.
         using (CoreServiceAgent coreAgent = new CoreServiceAgent())
         {
             coreAgent.KeepServerAlive();
         }
     }
     catch { }
 }
Exemplo n.º 2
0
        public static void KeepImportServiceAlive()
        {
            try
            {
                Debug.WriteLine(String.Format("{0:HH:mm:ss} - KeepImportServiceAlive called", DateTime.Now));

                // Inform the local system we need it.
                SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED);

                // Tell the server we still need it.
                using (CoreServiceAgent coreServiceAgent = new CoreServiceAgent())
                {
                    coreServiceAgent.KeepServerAlive();
                }
            }
            catch { }
        }
Exemplo n.º 3
0
        public static void KeepImportServiceAlive()
        {
            try
            {
                Debug.WriteLine(String.Format("{0:HH:mm:ss} - KeepImportServiceAlive called", DateTime.Now));

                // Inform the local system we need it.
                SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED);

                // Tell the server we still need it.
                using (CoreServiceAgent coreServiceAgent = new CoreServiceAgent())
                {
                    coreServiceAgent.KeepServerAlive();
                }
            }
            catch { }
        }
 private static void DoKeepAlive()
 {
     try
     {
         // Inform the local system we need it.
         SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED);
         // Tell the server we need it.
         using (CoreServiceAgent coreAgent = new CoreServiceAgent())
         {
             coreAgent.KeepServerAlive();
         }
     }
     catch { }
 }