timer problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
i have a windows service which is checking to the desire URL and check
back its httpwebresponse data. and, i save the result in a log file insdie
local drive. i use a timer to trigger my service's function that check to my
desire URL response. the problem is with that timer. since my timer's data
type is double, my friend suggest that if it reach to its maximum value my
service will get error or it will stop. he had faced with that situation
before, but couldn't find out a solution. so, i'ld like to know if it is
true, is there any solution to triger my service's function at every 5 minute
or at a require interval, like i used to check with timer.
and, here is some of the code that i used with.

public main()
{
double interval = 300000;
myTimer = new Timer(interval);
myTimer.Elapsed += new ElapsedEventHandler(svsTimer_Elapsed);
}

void svsTimer_Elapsed(object sender, ElapsedEventArgs e)
{
WebRequest wReq = HttpWebRequest.Create("http://www.yahoo.com");
HttpWebResponse wRes = (HttpWebResponse)wReq.GetResponse();
string strResult = Res.StatusCode.GetHashCode().ToString();
}
 
I think your friend doesn't know what he/she's talking about/ What "maximum
value?" The timer's interval never changes, so it isn't going to reach any
"maximum value." The timer isn't counting anything. It simply fires an event
every [interval] milliseconds.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
Back
Top