Sleep after FileWatcher

T

tshad

I have a Thread that is running a FileSystemWatcher in my Windows Service.

If file shows up then I want to handle it around 12:00 that night or 1:00am
the next day.

Is there a timer that I can just pass the time of day to start if a file
shows up in the folder my program is watching, instead of calculating the
difference in time and use either a Timer or Thread.Sleep?

Thanks,

Tom
 
S

Stanimir Stoyanov

Hi Tom,

All built-in Timer classes in .NET Framework expect an interval of time to
start in.
 
P

Peter Morris

Why not run a job at 12 and 1 each day and have it decide which files to
process?
 
T

tshad

Peter Morris said:
Why not run a job at 12 and 1 each day and have it decide which files to
process?

Actually, that was what we decided to do last night.

All I had to do was strip out all the services code and it works fine. Much
easier than setting it up :)

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top