I want to make the services that I would like to install in server, it should run the batch file once I will send one specific file to the folder
I start from this can someone guide me how i finish.
Thanks
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.ServiceProcess;
using System.Text;
using System.Threading;
namespace FolderWatch
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
private System.Timers.Timer timer1;
protected override void OnStart(string[] args)
{
WriteLogs("Starting ..... ");
timer1 = new System.Timers.Timer();
timer1.Interval = 15000;
timer1.Elapsed += timer1_Elapsed;
timer1.Start();
}
void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
//WriteLogs("Interval click");
timer1.Stop();
watching();
timer1.Start();
}
private static void watching()
{
try
{
// WriteLogs("Watching Start");
string sourcePath = @"C:\ESLFile\";