zoukankan      html  css  js  c++  java
  • C# 卡控时间输入

            int hour = (int.Parse(DateTime.Now.Hour.ToString())) * 60;
            int minute = int.Parse(DateTime.Now.Minute.ToString());
            int nowTime = hour + minute;

            int hour1 = (int.Parse(txthour.Text)) * 60;

            int minute1 = (int.Parse(txtmin.Text));

            int oldTime = hour1 + minute1;

            if ((nowTime - oldTime) > 30)

      {

        lblMsg.Text = "登記時間應在當前時間的前30分鐘內!" ;
                  lblMsg.ForeColor = System.Drawing.Color.Red;
                  txthour.ForeColor = System.Drawing.Color.Red;
                  txtmin.ForeColor = System.Drawing.Color.Red;
                  return;

           }

        else if ((nowTime - oldTime) < 0)

         {

          lblMsg.Text = "登記時間不應在當前時間之後!" ;
                  lblMsg.ForeColor = System.Drawing.Color.Red;
                     txthour.ForeColor = System.Drawing.Color.Red;
                     txtmin.ForeColor = System.Drawing.Color.Red;
                     return ;

       }

  • 相关阅读:
    通过mysql命令行理解mysql
    yii2.0框架安装心得
    浅谈我的编程之路——感谢引领我的leader
    谈谈我的编程之路---WAMP(四)
    谈谈我的编程之路---WAMP(三)
    Sql语句优化之explan分析案例
    mysql技术内幕笔记
    Sql语句优化
    linux变量
    sql查询慢优化
  • 原文地址:https://www.cnblogs.com/ximi07/p/10605306.html
Copyright © 2011-2022 走看看