I've made a test using the Timer Component and it work *almost* fine.
The code on the Enabled event is like this:
System.IO.TextWriter writer = new
System.IO.StreamWriter("d:/tmp/global_timer.log", true);
writer.WriteLine(String.Format("Log time: {0:F}", DateTime.Now));
writer.Flush();
writer.Close();
However the log is being appended twice.
Here's a chunk of the log:
App Started at Friday, January 21, 2005 12:55:56 AM
Log time: Friday, January 21, 2005 12:56:56 AM
Log time: Friday, January 21, 2005 12:56:56 AM
Log time: Friday, January 21, 2005 12:57:56 AM
Log time: Friday, January 21, 2005 12:57:56 AM
Log time: Friday, January 21, 2005 12:58:56 AM
Log time: Friday, January 21, 2005 12:58:56 AM
Log time: Friday, January 21, 2005 12:59:56 AM
Log time: Friday, January 21, 2005 12:59:56 AM
The first line is logged on the Application.Start method, with similar code.
Regards,
Manuel.
"Jiri Zidek" wrote:
Try using System.Timer inside of Application.Start in global.asax. It can
trigger a new thread in defined intervals. Maybe enough for you, but aware
that this would be running under aspnet working thread and corresponding
privildges.
"Khurram Hanif" <kh********@yahoo.com> pÃ*se v diskusnÃ*m prÃ*spevku
news:eK**************@TK2MSFTNGP10.phx.gbl...
I want to auto run asp.net page after a fixed interval of time without
sending any request from browser to server. I dont want to use windows
service or something like that.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!