You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.6 KiB
53 lines
1.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.ServiceProcess;
|
|
using System.Text;
|
|
using System.Configuration;
|
|
using AutoFileCopyNet;
|
|
using AutoFileCopyNet.EngelFileAnalytic;
|
|
|
|
namespace AutoFileAnalyticService
|
|
{
|
|
partial class EngelFileAnalyticService : ServiceBase
|
|
{
|
|
public EngelFileAnalyticService()
|
|
{
|
|
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void OnStart(string[] args)
|
|
{
|
|
// TODO: 在此处添加代码以启动服务。
|
|
}
|
|
|
|
protected override void OnStop()
|
|
{
|
|
// TODO: 在此处添加代码以执行停止服务所需的关闭操作。
|
|
}
|
|
|
|
private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
lock (this)
|
|
{
|
|
System.Threading.Thread.Sleep(10000);
|
|
// TODO: 在此处添加代码以启动服务。
|
|
int engel_frequency = int.Parse(ConfigurationSettings.AppSettings["frequency"].ToString());
|
|
Engel job = new Engel();
|
|
job.Run();
|
|
timer.Interval = engel_frequency * 60000;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogFileAccess.WriteLogFile("恩格尔数据文件拷贝复制文件服务启动失败!"+ex.StackTrace+"-------" + ex.Message + "-------------"+ex.Source);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|