-5

I have a date and time in code, that i want to invoke a specific method. This date and time also might be recurrence. I will run this on IIS server if that's matter.

Is there a way in C# to do it?

Ido
  • 951
  • 1
  • 13
  • 27
  • 8
    The simplest solution is to create a console application and schedule it using the Windows Task scheduler. Why reinvent the wheel? – Heinzi Feb 16 '12 at 16:05
  • This topic has been answered a lot of SO, I suggest doing a search to see what has been said before – Peter Monks Feb 16 '12 at 16:07
  • I did. all of them referce me to the windows scheduler or to some other frameowrks. I really do need a simple thing. – Ido Feb 16 '12 at 16:11

3 Answers3

5

Take a look at Quartz.net

I think you would probably need to break your code out into a service of some kind. Running scheduled task isn't what IIS is meant for.

Antony Scott
  • 21,690
  • 12
  • 62
  • 94
1

Another tool is Visual Cron. I have used this in a production environment and it works great! http://www.visualcron.com/

Antony Scott
  • 21,690
  • 12
  • 62
  • 94
Zaffiro
  • 4,834
  • 5
  • 36
  • 47
0

You might want a Timer, the ElapsedEventHandler can call functions for you, and they can be set up to reoccur.

LightLabyrinth
  • 362
  • 3
  • 14