在web 里面用C#写个时间跳动程序,但不是this.Label1.Text=System.DateTime.Now.ToString();  我想要或得秒的变化,该如何呢?

解决方案 »

  1.   

    System.DateTime.Now.Second.ToString()
      

  2.   

    System.DateTime.Now.Second.ToString()
    这个正解
      

  3.   

    楼上均非正解,如果我没理解错,他要的是时间跳动的,你们给的只是秒。一般这个可以采用Timer或者线程来实现。不过WEB的话,一般都是用JS取客户端时间,然后通过setTimeout实现,你要服务器的时间精确的在客户端显示很难,因为有网络延迟的问题。