c# – Timers using windows service/webapplication – Education Career Blog

1) In my application am scheduling meetings. 2) am collecting payment installments for purchase of an item (it has payment due dates). 3) Now I want to send notifications to the users i) for schedule events I need to send notification 5 min before the meeting time ii) for payment dues I need to send notifications from one week before to till payment due date

My application is a webapplication

,

1) In my application am scheduling meetings.

Store the scheduled meeting date somewhere persistent (e.g. in a database).

2) am collecting payment installments for purchase of an item (it has payment due dates).

Store the payment due date somewhere persistent (e.g. in a database).

3) Now I want to send notifications to the users

Send notification by email? Or send notification via HTML to their browser when they navigate to your webapplication?

i) for schedule events I need to send notification 5 min before the meeting time

Occasionally (e.g. once/minute) query your database to see which users have meetings scheduled within the next 5 minutes.

,

ASP.NET isn’t great for something like this, because there is no guarantee that your application will be running at the moment it needs to perform the necessary processing.

It would be better to write either a Windows Service or a console app (triggered by Windows Task Scheduler). The service/app could use a timer (or poll/sleep loop) to check for items that need to be processed.

,

You need a scheduling framework like Quartz.Net

Leave a Comment