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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question 1

Status
Not open for further replies.

rskiko

Programmer
Mar 17, 2004
10
TN
Hi,
I'm working on a networking project. I have to execute a function every period of time ( 15 min for example).
I don't know how to do this in C# 'cause I'm a beginner in C# programming.
Can someone find me a solution for my case. Thanks in advance
 
Code:
System.Timers.Timer timer = new System.Timers.Timer(15 * 60 * 1000);

timer.Elapsed += new System.Timers.ElapsedEventHandler(onTick);
timer.Start();

And then onTick is your function...defined thus:
Code:
private void onTick(object source,System.Timers.ElapsedEventArgs e)
{
}

Hollingside Technologies, Making Technology work for you.
 
Thanks mrscary for help, that's what i really need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top