protected override void OnStart(string[] args)
 {
     // TODO: Add code here to start your service.
     using (ServiceConnector request = new ServiceConnector())
     {
         System.Threading.Timer oTimer1;
         TimerCallback timerDelegate1 = new TimerCallback(request.ProcessImportRecipients);
         oTimer1 = new System.Threading.Timer(timerDelegate1, "true", 0, System.Threading.Timeout.Infinite);
     }
 }
예제 #2
0
        private void OnElapsedTime(object source, ElapsedEventArgs e)
        {
            time.Enabled = false;
            // Run system code here
            using (ServiceConnector request = new ServiceConnector())
            {
                request.EmailSentCount(true);
            }

            time.Interval = 1000;
            time.Enabled = true;
        }
예제 #3
0
        protected override void OnStart(string[] args)
        {
            // TODO: Add code here to start your service.

            using (ServiceConnector Connector = new ServiceConnector())
            {
                //System.Threading.Timer oTimer1;
                //TimerCallback timerDelegate1 = new TimerCallback(Connector.EmailSentCount);

                //oTimer1 = new System.Threading.Timer(timerDelegate1, "true", 0, System.Threading.Timeout.Infinite);
                time.Elapsed += new ElapsedEventHandler(OnElapsedTime);
                time.Interval = 1000;
                time.Enabled = true;

                //System.Threading.Timer Timer2;
                //TimerCallback timerDelegate2 = new TimerCallback(Connector.ClientStatus);

                //Timer2 = new System.Threading.Timer(timerDelegate2, "true", 0, System.Threading.Timeout.Infinite);
            }
        }