123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Diagnostics;
- using System.ServiceProcess;
- using System.Text;
- using System.Net;
- using System.Net.Sockets;
- using System.Threading;
- using System.Management;
- namespace LYFZ.WcfSystemService
- {
-
-
-
-
-
-
-
-
-
- public partial class LYFZ_ErpWcfService : ServiceBase
- {
- private LYFZ.WindowsServiceHandling.MainService mainService = new LYFZ.WindowsServiceHandling.MainService();
- public LYFZ_ErpWcfService()
- {
- InitializeComponent();
-
- mainService.InitializeConstructor();
-
- }
-
-
-
- protected void SetTimerRunWork()
- {
- System.Timers.Timer t = new System.Timers.Timer();
- t.Interval = 1000 * 10;
- t.Elapsed += new System.Timers.ElapsedEventHandler(RunWork);
- t.AutoReset = true;
- t.Enabled = true;
- }
- public void RunWork(object source, System.Timers.ElapsedEventArgs e)
- {
-
-
- ServiceWriteLog("定时任务正在执行...");
- }
-
-
-
-
- protected void ServiceWriteLog(string txt)
- {
-
- }
-
-
-
-
- protected override void OnStart(string[] args)
- {
-
- mainService.OnStart(args);
- }
-
-
-
- protected override void OnStop()
- {
- mainService.OnStop();
-
- }
-
-
-
- protected override void OnPause()
- {
- mainService.OnPause();
- }
-
-
-
- protected override void OnContinue()
- {
- mainService.OnContinue();
- }
-
-
-
- protected override void OnShutdown() {
- mainService.OnShutdown();
- }
- }
- }
|