Example #1
0
        protected override void OnStart(string[] args)
        {
            //encrypt the config file connection strings when the service starts

            EncryptConfigurationFile.EncryptConfigFile();

            WriteToFile("Service is started at " + DateTime.Now);
            timer.Enabled  = true;
            timer.Interval = scheduleTime.Subtract(DateTime.Now).TotalSeconds * 1000;
            timer.Elapsed += new System.Timers.ElapsedEventHandler(onElapsedTimer);

            base.OnStart(args);
        }