execute a certain task every one hour in server
-
Hi I want to a certain task every one hour in server in my ASP .NET 4 project, I was wondering where should i put my codes to execute. Thank you guys
-
Hi I want to a certain task every one hour in server in my ASP .NET 4 project, I was wondering where should i put my codes to execute. Thank you guys
For starters, don't put repetitive server code in a web application because then you will need something to trigger the process anyway. Why not investigate using a Windows Service or an application that is setup to be run by the Windows Task Scheduler.
I wasn't, now I am, then I won't be anymore.
-
Hi I want to a certain task every one hour in server in my ASP .NET 4 project, I was wondering where should i put my codes to execute. Thank you guys
The best way to do this is by writing a windows service and run it on the server. this windows service can be written in such a way that it will do some particular task every hour.
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
-
For starters, don't put repetitive server code in a web application because then you will need something to trigger the process anyway. Why not investigate using a Windows Service or an application that is setup to be run by the Windows Task Scheduler.
I wasn't, now I am, then I won't be anymore.
thank you so much for your answer but i only have a shared hosting plan not a dedicated server and i definitely don't have access to those kinds of resources.
-
The best way to do this is by writing a windows service and run it on the server. this windows service can be written in such a way that it will do some particular task every hour.
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
thank you so much for your answer but i only have a shared hosting plan not a dedicated server and i definitely don't have access to those kinds of resources.
-
thank you so much for your answer but i only have a shared hosting plan not a dedicated server and i definitely don't have access to those kinds of resources.
In that case, I will have to suggest a very very dirty workaround for tackling this problem. 1. Have a page that will do the required task. do the required task only when a specific query string is present. This way you will ensure that only you know this actual link that will perform this operation. 2. Now whenever you access this page with this specific query string this task will run. you can do it manually but you can still automate it. lets see how: 3. create a simple
winform
application withwebbrowser
control in it and navigate it to the required page with the specificquerystring
. all hard coded in thepage_load
. so when application opens up your task is done. close this app in webbrowsernavigated
event. 4. Now configure a windows service on your PC that will run this application on a specified time. P.S. all this assuming that the task you need to perform is not time consuming otherwise you will get timeout problem. Note: I am not recommending this approach. it is very very bad. but in desperate times such workarounds do work.Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
-
Hi I want to a certain task every one hour in server in my ASP .NET 4 project, I was wondering where should i put my codes to execute. Thank you guys
-
Hi I want to a certain task every one hour in server in my ASP .NET 4 project, I was wondering where should i put my codes to execute. Thank you guys
Is this a task SQL server based? maybe you could write a SQL job and have it scheduled. (if your hosting agreement allows it) Just a thought.
-
Hi I want to a certain task every one hour in server in my ASP .NET 4 project, I was wondering where should i put my codes to execute. Thank you guys
As you are using shared hosting, it is not possible to connect to windows service as this will not be allowed. Create a web page which will do the task (as per your requirement - say adding some data or sending mail etc). Use query string to specify your parameters. Don't forget to encrypt the querystring value for security concern. Now the interesting thing, create a windows service in your local machine which calls the above mentioned aspx page with querystring value. Thus the page is fired in background and the code behind of the page will do the rest. Thanks, Sandip
-
Hi I want to a certain task every one hour in server in my ASP .NET 4 project, I was wondering where should i put my codes to execute. Thank you guys
hi can you use timer control and set timer interval to hours to milisecod