コード例 #1
0
        /// <summary>
        /// 暂停JOB
        /// </summary>
        /// <param name="jobName"></param>
        /// <returns></returns>
        public static bool PauseJob(string jobName)
        {
            if (string.IsNullOrEmpty(jobName))
            {
                return(false);
            }
            JobKey _JobKey = SchedulerSession.GetJob(jobName);

            if (null != _JobKey)
            {
                scheduler.PauseJob(_JobKey);
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        public static bool ShutDownJob(string jobName)
        {
            if (string.IsNullOrEmpty(jobName))
            {
                return(false);
            }
            JobKey _JobKey = SchedulerSession.GetJob(jobName);

            if (null != _JobKey)
            {
                scheduler.PauseJob(_JobKey);
                bool retval = scheduler.DeleteJob(_JobKey);
                if (retval)
                {
                    SchedulerSession.RemoveJob(jobName);
                }
                return(retval);
            }
            else
            {
                return(false);
            }
        }