Autostart application after copied the file

  • Thread starter Thread starter naweez
  • Start date Start date
N

naweez

Guest
I am using C# 4.5 and SQL Server 2014. I wrote a console application which takes 3 file names and folder which is defined in the app.config file and validates the data and imports the data in SQL Server.

I have given FTP portal to the client, they upload the data and informed me then manually I am running my exe file then data is importing. But I want an automatic process like once the client uploads 3 files in folder my console application auto start.

I thought of using FileSystemWatcher, but here problem is that if put file watcher to folder, create file event, I am getting event when the file is created, this will not work because I need the event when 3 files copied successfully.

This is my app.config file

<appSettings>
<add key="SourceFolder" value="E:\UploadData" />
<add key="ArchiveFolder" value="E:\UploadData\Archive" />
<add key="LogFile" value="E:\UploadData\LogFile" />

<add key="DisbursementFile" value="xxx_DISB.csv" />
<add key="EmployeeFile" value="xxx_EMP.csv" />
<add key="AmountFile" value="xxx_AMT.csv" />
</appSettings>




Thanks Best Regard Naweez

Continue reading...
 
Back
Top