-1

i have full access to server i want to run C# code on server automatically and every minute it should repeat. Is there any techniques or web services allow allow asp.net project regarding same? I cant able to find correct reference. Post a link here if possible. I have ready code that allows my work on Page_Load. But I want to make such like , whole code should be Running every 5 minutes.

RFID #Attendance #RealTime

Community
  • 1
  • 1

2 Answers2

0

Similar question to what you have asked. Best way to run scheduled tasks

All of my tasks (which need to be scheduled) for a website are kept within the website and called from a special page. I then wrote a simple Windows service which calls this page every so often. Once the page runs it returns a value. If I know there is more work to be done, I run the page again, right away, otherwise I run it in a little while. This has worked really well for me and keeps all my task logic with the web code. Before writing the simple Windows service, I used Windows scheduler to call the page every x minutes.

Another convenient way to run this is to use a monitoring service like Pingdom. Point their http check to the page which runs your service code. Have the page return results which then can be used to trigger Pingdom to send alert messages when something isn't right.

Community
  • 1
  • 1
Srikanth
  • 86
  • 1
  • 4
  • 11
0

You have many options:

1- put the code in a web service, and create a consumer windows service to invoke it every N minutes.

2- put your code in a windows service and execute it from a timer.

3- Make a thread in the web-page (Not recommended) to execute your code.

Hope that helps you

Abusnake
  • 168
  • 11