-2

Using asp.net, I want to run a method say void add() for a particular period of time, say from 9am to 6pm and also for some days (eg:7 days)

lmcanavals
  • 2,197
  • 1
  • 21
  • 33
sarvan
  • 85
  • 6
  • You'll have to explain a little further; are you talking about a background job that should run all the time between those hours, or are you talking about a function run on every request that should check the time and only run if the time is between those hours? – Joachim Isaksson Mar 10 '12 at 08:43
  • possible duplicate of [What is the Windows version of cron?](http://stackoverflow.com/questions/132971/what-is-the-windows-version-of-cron) – Mike Samuel Mar 11 '12 at 04:22

2 Answers2

1

I'd try using Windows Services for something like that.

Here some info how: http://msdn.microsoft.com/en-us/library/zt39148a(VS.80).aspx

lmcanavals
  • 2,197
  • 1
  • 21
  • 33
1

The functionality you are describing is not a good fit for ASP.NET per se. Performing work at given times is better suited for Scheduled Tasks, or possibly a Windows Service (which you could create in a .NET language). You could certainly display the results using ASP.NET, but ASP.NET is primarily a way for allowing on demand interaction using a browser, not server side scheduled interaction.

cmsjr
  • 49,560
  • 10
  • 66
  • 62