Page 3 - How to Create Timer Job in SharePoint 2013
P. 3

How to Create Timer Job in SharePoint 2013                     https://www.c-sharpcorner.com/UploadFile/b8e86c/how-to-create-timer-...














































                   01.   using Microsoft.SharePoint;
                   02.   using Microsoft.SharePoint.Administration;
                   03.   public class TimerJobDemo:SPJobDefinition
                   04.   {
                   05.   }





                   01.   public TimerJobDemo():base()
                   02.   {
                   03.   }
                   04.
                   05.   public TimerJobDemo (string jobName, SPService service) : base(jobName, service, null, SPJobLockType.None)

                   06.   {
                   07.       this.Title = "Demo Timer Job";
                   08.   }
                   09.
                   10.
                   11.   public TimerJobDemo(string jobName, SPWebApplication webapp) : base(jobName, webapp, null, SPJobLockType.Conte
                   12.   {
                   13.       this.Title = "Demo Timer Job";
                   14.   }






                   01.   SPWebApplication webApp = this.Parent as SPWebApplication;
                   02.   SPList taskList = webApp.Sites[0].RootWeb.Lists["TimerLists"];
                   03.   SPListItem newTask = taskList.Items.Add();




 3 of 14                                                                                                  23-Jan-19, 10:46 AM
   1   2   3   4   5   6   7   8