|
I want autorun a function (ex: send mail every day,...) in my web ASP.NET but dont use Windows Service. Server Asp allway auto. Please help me!
Thank you read!
|
|
|
|
|
ngoanrazor wrote: I want autorun a function (ex: send mail every day,...) in my web ASP.NET but dont use Windows Service You can write a simple console application which send the mail. Schedule this application using Windows scheduler.
Best wishes,
Navaneeth
|
|
|
|
|
Thank you reply!
I dont want use Windows scheduler. Is it possible when use ASP to autorun?
|
|
|
|
|
Sir;
ASP.NET works under IIS which is a web server that recieve http requests and send http reponses but it can't run periodic tasks.
Help people,so poeple can help you.
|
|
|
|
|
ngoanrazor wrote: Is it possible when use ASP to autorun? You could hack it up. But it won't be stable and not recommended for a production system.
To do that, start a thread which loops on an infinite loop.
while(true)
{
Thread.Sleep(someTime);
} This will work but when IIS recycles the ASP.NET process, it will kill this thread. Like I said before, this is not stable.
Best wishes,
Navaneeth
|
|
|
|
|
Well there is a technique using cache object expiration where you can get
a function of your own to run, search on google for:
asp.net cache scheduled task
and you can find working code.
Good luck.
/jc
|
|
|
|