Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timers in Windows Services

Status
Not open for further replies.

domenu

Programmer
May 31, 2002
30
BE
Hey,

I am writing a Windows service application in C#.

In this service, I am using a timer that performs actions at a certain time.

My problem: this timer does not seem to run.

When I create a simple Windows Service applic, with only 1 timer in it, it does not work either...

What to do to activate this timer in a simple Windows service.

My timer is enabled in the code, that's for sure!

Can anybody help me out, please???

Thanks in advance


nick;
 
Put here a pice of the code or you have to have a minimum like here:
Code:
System.Timers.Timer TimerUserAuthenticationTimeOut = new System.Timers.Timer();
						TimerUserAuthenticationTimeOut.Interval = TimerUserAuthenticationTimeOutValue * 1000;
											TimerUserAuthenticationTimeOut.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerUserAuthenticationTimeOutEvent);
						TimerUserAuthenticationTimeOut.Enabled = true;

private void OnTimerUserAuthenticationTimeOutEvent(object source, System.Timers.ElapsedEventArgs e)
{
	System.Timers.Timer obj = (System.Timers.Timer) source;
	//...
}
-obislavu-
 
Which timer class are you using? There are three of them in the framework.

I would suggest using for this application, the one from the Threading namespace.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top