How do I write a Alert which will run at 00:00, 00:15, 00:30, and so on every day?
Can you give me an example code?
Thank you.
How do I write a Alert which will run at 00:00, 00:15, 00:30, and so on every day?
Can you give me an example code?
Thank you.
There are different timers in .NET
Depending on what you want to do (and in which environment, threadsave, bla bla) you should choose one of them.
some more information
If you want the windows service that executes some code with some time interwal, you need to create the service project (see here), and use in this service the Timer class (see here). If you want to run these task when your windows application is executes, use the Windows.Forms.Timer, as mentioned before.
You can write your program to execute certain task every time it is opened then you use Windows Scheduled Tasks to execute your program every day at certain times.
your program will be simpler and you will focus only on the logic you need to implement, the scheduling will be done by Windows for you, for free (assuming you already paid Windows :) ).
if you really want to implement the scheduling by yourself, there are frameworks and libraries like this one: Quartz.NET
Here is a basic C# scheduler:
For example:
You can use a timer that runs every minute that checks the current time. The check can look like:
But if you are looking for a program or service that has to be run every 15 minutes you can just write your application and have it started using a windows planned task.