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. 8 1499
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,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
<Pa*********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com... 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.
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,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
<Pa*********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com... 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.
The windows task sheduler has been disabled and I'm not allowed to use
it.
I can't use the FileSystemWatcher as the folders exist on an extranet
and I can't set up any webfolders on my server.
Sorry I forgot to mention that in the previous post
regards
Paul
The windows task sheduler has been disabled and I'm not allowed to use
it.
I can't use the FileSystemWatcher as the folders exist on an extranet
and I can't set up any webfolders on my server.
Sorry I forgot to mention that in the previous post
regards
Paul
On 31 Aug 2005 06:28:06 -0700, Pa*********@gmail.com wrote: 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.
Set your Windows service to start automatically, this way it will be always
running. Then use a System.Threading.Timer for you sheduled jobs. One of
its overloaded constructors takes 2 TimeSpan as parameters. The first one
is the time before the first callback invoke (set it to the time remaining
before 4am) and the second one is the time between 2 callback invokes (set
it to 20 minutes). When the callback method is invoked, check the time: if
it's 6am or later, Dispose your timer to stop it and recreate one for the
next day; if it's before 6am, do whatever you have to do.
Be carefull not to use using a System.Timers.Timer as it seems to be buggy
when used whithin a Windows Service (see http://support.microsoft.com/default...b;en-us;842793)
On 31 Aug 2005 06:28:06 -0700, Pa*********@gmail.com wrote: 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.
Set your Windows service to start automatically, this way it will be always
running. Then use a System.Threading.Timer for you sheduled jobs. One of
its overloaded constructors takes 2 TimeSpan as parameters. The first one
is the time before the first callback invoke (set it to the time remaining
before 4am) and the second one is the time between 2 callback invokes (set
it to 20 minutes). When the callback method is invoked, check the time: if
it's 6am or later, Dispose your timer to stop it and recreate one for the
next day; if it's before 6am, do whatever you have to do.
Be carefull not to use using a System.Timers.Timer as it seems to be buggy
when used whithin a Windows Service (see http://support.microsoft.com/default...b;en-us;842793)
Thanks Mehdi....
You've given me a great starting point....I'
I'll give it a bash and see how I progress!
Thanks Mehdi....
You've given me a great starting point....I'
I'll give it a bash and see how I progress! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dmitry Demchuk |
last post by:
Hi everybody.
Recently I ran into situation with System.Threading.Timer in my ASP.NET
application. I reinstalled Windows on one of my servers and got timers stop
firing events after while, they...
|
by: Jason |
last post by:
Hi all
just a quick question. I have a windows service with a "Catalogue" class.
I would like to know: if i put two "ServiceTimer" objects in my service
1. Do they run in separate threads...
|
by: Nathan Kovac |
last post by:
I have a feeling I am missing something simple, but I just can't find it.
Perhaps someone can give me a lead on where to look. I will describe the
issue then post my code to the web service. My...
|
by: Mark Rae |
last post by:
Hi,
I've seen several articles about using System Timers in ASP.NET solutions,
specifically setting them up in Global.asax' Application_OnStart event.
I'm thinking about the scenario where I...
|
by: james.e.coleman |
last post by:
Hello,
System.Timers.Timer/System.Threading.Timer do not fire on my
development server, yet they work perfectly on the production server.
I would appreciate any help on what the cause of this...
|
by: jeff |
last post by:
Greetings;
Newbie here, please forgive my ignorance of the vb.net
threading model.
I am developing a windows service which is driven by a
variable number of timers. All timers use the same...
|
by: jeff |
last post by:
Greetings;
Newbie here, please forgive my ignorance of the vb.net
threading model.
I am developing a windows service which is driven by a
variable number of timers. All timers invoke the same...
|
by: cntams |
last post by:
All,
I have a Windows Service and it has one System.Timers.Timer that
fires every 500 milliseconds. Now I have noticed that there's a bug in
System.Timers.Timer when it's being used combined with...
|
by: Tony Gravagno |
last post by:
I have a class that instantiates two Timer objects that fire at
different intervals. My class can be instantiated within a Windows
Form or from a Windows Service. Actions performed by one of the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |