Example #1
0
        void performActions(string strTitle, string strAction, string strButtonName, int intType)
        {
            countDown objCD = new countDown(strTitle, strAction, strButtonName);

            objCD.ShowDialog(this);
            currentRemindTimer = objCD.doubleDelayer;
            if (currentRemindTimer == 0)
            {
                // Shutdown
                if (intType == 0)
                {
                    Process.Start("shutdown", "/s /t 60 /c \"Shutdown by Scheduler.\"");
                }
                // Restart
                else if (intType == 1)
                {
                    Process.Start("shutdown", "/r /t 60 /c \"Restart by Scheduler.\"");
                }
                // Log Off
                else if (intType == 2)
                {
                    Process.Start("shutdown", "/l");
                }
            }
        }
Example #2
0
 void performActions(string strTitle,string strAction,string strButtonName, int intType)
 {
     countDown objCD = new countDown(strTitle, strAction, strButtonName);
     objCD.ShowDialog(this);
     currentRemindTimer = objCD.doubleDelayer;
     if (currentRemindTimer == 0)
     {
         // Shutdown
         if (intType == 0)
         {
             Process.Start("shutdown", "/s /t 60 /c \"Shutdown by Scheduler.\"");
         }
         // Restart
         else if (intType == 1)
         {
             Process.Start("shutdown", "/r /t 60 /c \"Restart by Scheduler.\"");
         }
         // Log Off
         else if (intType == 2)
         {
             Process.Start("shutdown", "/l");
         }
     }
 }