示例#1
0
        private bool CreateJob(SPWebApplication site)
        {
            bool jobCreated = false;

            try
            {
                EmailAlert       job      = new EmailAlert(JobName, site);
                SPMinuteSchedule schedule = new SPMinuteSchedule();
                schedule.BeginSecond = 0;
                schedule.EndSecond   = 59;
                schedule.Interval    = 10;

                job.Schedule = schedule;
                job.Update();
            }
            catch (Exception)
            {
                return(jobCreated);
            }
            return(jobCreated);
        }