protected override void OnStart(string[] args) { logger = LogManager.GetLogger("文件监控服务启动"); logger.Info("文件监控服务准备启动"); g_FilePathWatch = new FileWatch(); g_FilePathWatch.Start(); logger.Info("文件监控服务启动完毕"); // TODO: Add code here to start your service. }
private void StartService() { watch = new FileWatch(this.textBox1, this); watch.Start(); recyCount = string.IsNullOrEmpty(this.textBox3.Text) ? 0 : int.Parse(textBox3.Text); worker.RunWorkerAsync(recyCount); }