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 ;

       }

  • 相关阅读:
    ssh实现免密码登录和文件传输
    linux后台执行程序相关命令
    orchestrator
    curl下载安装与使用
    goland使用
    mysql集群
    consul理解
    my.cnf
    数据库的表设计
    项目常见面试问题
  • 原文地址:https://www.cnblogs.com/ximi07/p/10605306.html
Copyright © 2011-2022 走看看