Reputation: 6541
Hey I have a .NET .aspx page that I would like to run every hour or so whats the best way to do this ?
I assume it will have to open a browser window to do so and if possible that it closes the window after.
EDIT : I have access over all features on the server
Upvotes: 1
Views: 848
Reputation: 172468
Option 1: The cleanest solution would be to write a Windows application that does the work (instead of an aspx page) and schedule this application on the server using the Windows Task Scheduler. This has a few advantages over the aspx approach:
Of course, there are drawbacks as well:
Option 2: If you need to stick to an aspx page, the easiest solution is probably to call the page via a command-line web client in a scheduled task. Since Windows does not provide any built-in command-line web clients, you'd have to download one such as wget
or curl
. This related SO question contains the necessary command-line syntax:
Upvotes: 2
Reputation: 4360
You can use http://quartznet.sourceforge.net/ Quartz Job Scheduler.
With Quartz.net you can write a job which will request your web page with interval you choose.
or alternatively you can write an windows service which will request that web page.
Upvotes: 0
Reputation: 3606
use this sample to schedule a task in asp.net :
then you need to create Hit.aspx
page witch will do what you want. then you should call that page every time (using WebClient
class) the task execution time elapsed!
Upvotes: 0