zoukankan      html  css  js  c++  java
  • C# 增加where 判断条件 限制输入字符串长度, 正则,

    //string colorNameinput = this.txtcolorName.Text.Trim();
    //int colorNamecount = colorNameinput.Length;
    //if (colorNamecount > 15)
    //{
    // MessageBox.Show(this, "商品颜色不能超过15个字");
    // return;
    //}
    //string input = this.txtBaseNumber.Text.Trim();
    //string pattern = @"^([1-9]\d{0,8})$";

    //if (Regex.Match(input, pattern).Success == false)
    //{
    // MessageBox.Show(this, "商品库存数只能是小于9位的正整数");
    // return;
    //}

    //string remarkinput = this.txtremark.Text.Trim();
    //int remarkcount = remarkinput.Length;
    //if (remarkcount > 1000)
    //{
    // MessageBox.Show(this, "备注信息不能超过1000个字");
    // return;
    //}

  • 相关阅读:
    maven搭建
    javascript
    FTP工具类
    jsp相关知识
    java mail 邮箱发送
    servlet相关
    hibernate文档
    6月
    Spring AOP 使用总结
    spring事务配置总结
  • 原文地址:https://www.cnblogs.com/codejimmygao/p/14444932.html
Copyright © 2011-2022 走看看