Results 1 to 6 of 6

Thread: Timer in Windows Service (.NET)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2001
    Posts
    107

    Question 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

  2. #2
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    windows scheduler ?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2001
    Posts
    107
    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?

  4. #4
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164
    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...)
    -Shurijo

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2001
    Posts
    107
    Server-based timer meaning the Task Scheduler?

    ~Mike

  6. #6
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164
    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.
    -Shurijo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width