各位.NET大侠们,在下问个问题我又个表TimeListId   Time
1    2009-8-25 0:00:00我想做个倒计时功能,从此时到数据库中 (2009-8-25 0:00:00)的倒计时功能,在下.net初学者,请高手们告诉下,最好有代码。谢谢!

解决方案 »

  1.   

    你是B/S,還是C/S啊
    B/S就要用JAVASCRIPT了
    C/S比較簡單。
      

  2.   

    winform  timer控件
    webform  javascript setTimeout
      

  3.   

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default7.aspx.cs" Inherits="Default7" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    <script type="text/javascript">
     var TotalMinutes = 5;
     var TotalMilliSeconds = 5*60*1000;
        
     function takeCount()
     {
        //计数减一
        TotalMilliSeconds -= 1000;
        //计算时分秒
        var hours = Math.floor( TotalMilliSeconds / ( 1000 * 60 * 60 )) % 24;
        var minutes = Math.floor(TotalMilliSeconds / (1000 * 60)) % 60;
        var seconds = Math.floor(TotalMilliSeconds / 1000) % 60;
        //将时分秒插入到html中
        document.getElementById("RemainH").innerHTML = hours;
        document.getElementById("RemainM").innerHTML = minutes;
        document.getElementById("RemainS").innerHTML = seconds; 
     window.setTimeout("takeCount()",1000); 
     }
     </script></head>
    <body>
        <form id="form1" runat="server">
        <div>
        
     <div id="CountMsg">
         
    倒计时还有:
    <strong id="RemainD"></strong><strong id="RemainH">XX</strong>时
    <strong id="RemainM">XX</strong>分
    <strong id="RemainS">XX</strong>秒
    <input id="Button1" type="button" value="button"  onclick="takeCount()"/>
    </div>
        </div>
        </form>
    </body>
    </html>