日期:2014-05-20 浏览次数:20769 次
namespace ConsoleApplication1 { public class Program { public static void Main() { MyTimer timer = new MyTimer(); timer.Interval = 1000; timer.Elapsed += delegate(object sender, System.Timers.ElapsedEventArgs e) { Console.WriteLine(System.DateTime.Now); }; timer.Start(); Console.ReadKey(); } } public sealed class MyTimer : System.Timers.Timer { } }
------解决方案--------------------