标签:
C#定时器和事件
System.Timers.Timer myTimer;
private void Form1_Load(object sender, EventArgs e)
{
myTimer = new System.Timers.Timer(60000);//定时周期1分钟
myTimer.Elapsed += myTimer_Elapsed;//到1分钟了做的事件
myTimer.AutoReset = true; //是否不断重复定时器操作
}
//定时器执行事件
void myTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
GetUser(lblUserID.Text.Trim(), lblConnection.Text.Trim());
GetDepart(lblUserDepart.Text.Trim(), lblConnection.Text.Trim());
}
标签:
原文地址:http://www.cnblogs.com/qigege/p/5226700.html