Пример #1
0
        protected void OnElapsedTime(object sender, ElapsedEventArgs e)
        {
            PaxtonReport pr = new PaxtonReport();

            createDirectoryStructure();
            WriteToFile("Service is recall at " + DateTime.Now);
            pr.GenerateReport();
        }
Пример #2
0
        protected override void OnStart(string[] args)
        {
            PaxtonReport pr = new PaxtonReport();

            createDirectoryStructure();
            WriteToFile("Service is started at " + DateTime.Now);
            pr.GenerateReport();
            timer.Elapsed += new ElapsedEventHandler(OnElapsedTime);
            timer.Interval = 1000 * 60 * 60 * 24;
            //timer.Interval = 1000 * 60 * 5;
            timer.Enabled = true;
        }