zoukankan      html  css  js  c++  java
  • timer控件控制显示系统时间,随时更新

    Timer控件
    <asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">
                        </asp:Timer>今天是:<asp:Literal ID="LitDate" runat="server"></asp:Literal>
    cs:
     private void GetTimeString()
        {
            string week = DateTime.Now.DayOfWeek.ToString().ToLower();
            switch (week)
            {
                case "monday": week = "星期一"; break;
                case "tuesday": week = "星期二"; break;
                case "wednesday": week = "星期三"; break;
                case "thursday": week = "星期四"; break;
                case "friday": week = "星期五"; break;
                case "saturday": week = "星期六"; break;
                case "sunday": week = "星期日"; break;
                default:
                    break;
            }
            LitDate.Text ="<font color='#ffffff'>"+DateTime.Now.ToString()+" "+week+"</font>";
        }
    protected void Timer1_Tick(object sender, EventArgs e)
        {
            GetTimeString();
            if (!string.IsNullOrEmpty(NewMail()) && NewMail()!="0")
            {
                ImgNew.Visible = true;
            }
            else
            {
                ImgNew.Visible = false;
            }
        }

  • 相关阅读:
    vsftpd的详细配置讲解
    ActiveMQ安装与配置
    Apache安装完之后再安装其他模块
    搭建 LAMP apache2.4 + php5.5 + mysql5.5/6 配置文件没有作用的问题
    LAMP apache2.4 + php5.5 + mysql5.5/6
    进制之间的转换
    Mac 常用属性
    关于颜色值透明度的设置
    关于TextView 的属性
    Android 关于软键盘
  • 原文地址:https://www.cnblogs.com/ljan/p/2856802.html
Copyright © 2011-2022 走看看