求助。现在在VS2008中c#  怎么能实时显示时间

解决方案 »

  1.   

    timer设置间隔500毫秒实时读取 DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
      

  2.   

    就是设置一个定时器 设置为比较小的间隔 然后在定时器事件里显示当前时间。
    例如: System.Timers.Timer aTimer = new System.Timers.Timer();
     aTimer.Elapsed += new ElapsedEventHandler(TimedEvent);
     aTimer.Interval = 500;
     aTimer.Enabled = true; void TimedEvent(object source, ElapsedEventArgs e)
     {
       string time=DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
       //
     }