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 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();
}