|
-
Jul 28th, 2003, 11:41 AM
#1
Thread Starter
Lively Member
Timer in Windows Service (.NET)
I decided to write a Windows Service as opposed to a regular Windows app that could be run as a Scheduled Task. What is the best way to manually schedule the Service to kick off, for example, via a timer? I only need it to run once a day so that it can upload a file, and then upon knowledge of success of the upload, it will send out e-mail notification of the results.
Should I continuously thread the service, or would that be too much processing overhead?
Any input is appreciated.
Thanks,
Mike
-
Jul 28th, 2003, 11:52 AM
#2
Addicted Member
-
Jul 28th, 2003, 01:03 PM
#3
Thread Starter
Lively Member
The main reason for choosing services over using the Windows Task Scheduler is that the service is account-independent whereas the Task Scheduler requires that a true user be logged in so that it can run, at least from my understanding.
Such tasks are also a bit higher-maintenance. If they fail, I know of no way to communicate such failure or success to others. With a service you can have an e-mail sent out if something in your app fails.
So...help?
-
Jul 28th, 2003, 05:41 PM
#4
Addicted Member
I have always used a server-based timer for my services and it seems to work well. (meaning, I haven't had any issues so far...)
-
Jul 28th, 2003, 07:25 PM
#5
Thread Starter
Lively Member
Server-based timer meaning the Task Scheduler?
~Mike
-
Jul 29th, 2003, 10:29 AM
#6
Addicted Member
http://msdn.microsoft.com/library/de...asedTimers.asp
There are three timer controls in Visual Studio .NET and the .NET Framework — the server-based timer you can see on the Components tab of the Toolbox, the standard Windows-based timer you can see on the Windows Forms tab of the Toolbox, and the thread timer that is only available programmatically. The Windows-based timer has existed in Visual Basic since version 1.0, and has remained essentially unchanged. This timer is optimized for use in Windows Forms applications. The server-based timer is an update of the traditional timer that has been optimized to run in a server environment. The thread timer is a simple, lightweight timer that uses callback methods instead of events and is served by threadpool threads.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|