Here is a Sample timer
using System;
using System.Collections.Generic;
using System.Text;
using System.Security;
using System.Timers;
namespace Test
{
public class Program
{
Timer a = null;
public void OnElapsedTime(object source, ElapsedEventArgs e)
{
Console.WriteLine(DateTime.Now.ToString());
}
public void timercall()
{
Timer a = new Timer();
a.Elapsed += new ElapsedEventHandler(OnElapsedTime);
a.Interval = 60000;
a.Enabled = true;
}
static void Main(string[] args)
{
Program p = new Program();
p.timercall();
Console.ReadLine();
}
}
}
0 comments:
Post a Comment