SharePoint Timer Job properties

25/06/2015 14:07

   //This code is used in override Execute() method in class inherited from SPJobDefinition
   //read application settings from OWSTIMER.EXE.CONFIG in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN
 string siteUrl = System.Configuration.ConfigurationManager.AppSettings["TargetSiteUrl"];
 string listTitle = System.Configuration.ConfigurationManager.AppSettings["StatisticListTitle"];
 string isTestingMode = System.Configuration.ConfigurationManager.AppSettings["IsTestingMode"];

 #region Owstimer.exe.config appSettings node example
 //  <appSettings>
 //    <add key="TargetSiteUrl" value ="https://mysitecollection"></add>
 //    <add key="StatisticListTitle" value ="Statistics"></add>
 //    <add key="IsTestingMode" value ="True"></add>
 //   </appSettings>
 //</configuration>
 #endregion