随笔-295  评论-26  文章-1  trackbacks-0
  2019年9月15日



            //允许输入字母、点、回退键、数字
            if (((int)e.KeyChar >= (int)'a' && (int)e.KeyChar <= (int)'z') || (((int)e.KeyChar > 48 && (int)e.KeyChar < 57) || (int)e.KeyChar == 8 || (int)e.KeyChar == 46))
            {
                e.Handled = false;
            }
            else e.Handled = true;



      //允许输入字母、回退键、数字
            if (((int)e.KeyChar >= (int)'a' && (int)e.KeyChar <= (int)'z') || (((int)e.KeyChar > 48 && (int)e.KeyChar < 57) || (int)e.KeyChar == 8))
            {
                e.Handled = false;
            }
            else e.Handled = true; 


// 只能输入字母数字以及中文字
  if ((e.KeyChar != '\b') && (!Char.IsLetter(e.KeyChar)) && (!char.IsDigit(e.KeyChar)))
            {
                e.Handled = true;
            }

//只输入数字
 if (e.KeyChar != 8 && (!Char.IsDigit(e.KeyChar)))
            {
                e.Handled = true;
            }

只能输入数字以及字母X

  if (e.KeyChar != 88 && e.KeyChar != 8 && (!Char.IsDigit(e.KeyChar)))
            {
                e.Handled = true;
            }
posted @ 2020-06-13 10:46 华梦行 阅读(144) | 评论 (0)编辑 收藏
Install-Package NLog.Config -Version 3.2.1



Install-Package NLog -Version 3.2.1
posted @ 2020-01-06 16:10 华梦行 阅读(110) | 评论 (0)编辑 收藏
  • mysql5.7以上版本在常会报关于only_full_group_by的错误,可以在sql_mode中关闭他,网上查找的解
  • 在[mysqld]中添加代码
sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

重启mysql

sudo service mysql restart

mysql5.7以上版本在常会报关于only_full_group_by的错误,可以在sql_mode中关闭他,网上查找的解
查看参数是否存在

mysql> SELECT @@sql_mode;
+------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode                                                                                                             |
+------------------------------------------------------------------------------------------------------------------------+
| STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> SELECT @@GLOBAL.sql_mode;
+------------------------------------------------------------------------------------------------------------------------+
| @@GLOBAL.sql_mode                                                                                                      |
+------------------------------------------------------------------------------------------------------------------------+
| STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
posted @ 2019-09-15 22:02 华梦行 阅读(133) | 评论 (0)编辑 收藏