Ejemplo n.º 1
0
        protected override void OnStart(string[] args)
        {
            ThreadService = new Thread(new ThreadStart(ThreadProc));
            ThreadService.Start();

            ServiceLog.CoreLog("Messenger Executed Succesfully");
        }
Ejemplo n.º 2
0
        public void ThreadProc()
        {
            int waitTime = 1000; // 1 second

            try
            {
                do
                {
                    ServiceLog.DoWork();
                    Thread.Sleep(waitTime);
                    ServiceLog.CoreLog("Service is Doing Work");
                }while (true);
            }
            catch (ThreadAbortException e)
            {
                Debug.WriteLine(e.Message);
                ServiceLog.CoreLog(e.Message);
            }
        }
Ejemplo n.º 3
0
 protected override void OnStop()
 {
     ServiceLog.CoreLog("Service Aborted");
 }