2

I have a ASP.net web application that checks the status of my servers, it then wraps all this information up and puts it in a email. My Question how do I run this automatically say every day at like 2:00am, or like every 12 Hours?

Thanks

5 Answers 5

5

The best solution is to create a simple MS Windows Service which will do this job.

Sign up to request clarification or add additional context in comments.

2 Comments

+1 This way you can keep all your asp.net code and just call the page from the service.
Yes, do that. If you want help with scheduling, you could use Quartz.Net at quartznet.sourceforge.net
4

You'd better implement this as a separate process from your ASP.NET application. Phil Haack has summarized the reasons in this blog post. A Windows service for example or even a console application using the windows scheduler could work just fine for this task.

Comments

2

You want a scheduler - I recommend Quartz.NET.

As others have said, your code doesn't have to be in a web app.

If it is, then schedule a job that uses WebClient to make a request to your web app.

Comments

0

Check out WebDriver.

It's intended as a test / qa framework, but there's nothing stopping you from using it in a console application, which you can then run as a Scheduled Task. Note that whatever machine runs the Scheduled Task has to have a browser that WebDriver can fire up.

Comments

0

The easiest solution would be to create a scheduled task on your server using the Windows Task Scheduler and setup this job so that it uses internet explorer to visit your webpage.

If you open the task scheduler and create a new task. In the "Run" field put:

"C:\Program Files\Internet Explorer\IEXPLORE.EXE""http://www.yoursite.com/yourpage.aspx"

Then in the "Start in" field put:

"C:\Program Files\Internet Explorer"

Now configure this task to run at 2:00am every day.

2 Comments

Won't this just open a new Internet Explorer window on the server desktop? It's better to schedule a task that uses wget instead of Internet Explorer.
It will visit your web page using internet explorer. I don't know if it opens a window or not but there isn't anything left open once it has finished visiting the web page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.