Timers and Services

P

Paul.Hawkes

Hello,

I've written a windows service and so far what it does is browse to a
shared directory on an extranet. Check to see if any files exist in
this folder, if any do, the service downloads, processes and then
uploads a response file back up to a different shared folder.
My Question:
I would like to be able to start this service at 4am every day(I know
the download files won't be there until then)...then I want the service
to check for the files every say 20 mins until say 6am and then stop
chcking for the files until 4am the next day.

Has anyone done something like this and if so how. I have been looking
around but can't seem to find any info on anything like this.

Thanks in Advance.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Why don't use a scheduled job instead?


Anyway, the answer shoudl be yes, I have a similar deployment, I do not use
itmers, I use FileSystemWatcher instead and it work fine, I create and
initialize the watcher in the onload and the process keep waiting until the
event is received.
The above solution is something you should consider, it's safer, in any
case do not hardcode the times, it could change later on and you would have
to redeploy your solution


cheers,
 

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