ASP.Net: EshineASPNet教程-身份证校验与正则

完整教程链接:ASP.Net: EshineASPNet-基于ASP.Net敏捷开发开源框架

很多应用都会涉及到用户身份证的输入,严格的程序并不会接受用户随便输入一串字符,而应该检查身份证是否合法,这里并不是说检查这个身份证号是否存在,而是说身份证号是否符合规则。身份证号里面包含很多信息,大多数人知道的是出生日期,但其实18位字符里面每一位都是有讲究的,身份证校验只是个小话题,主要是温习一下正则在JS和C#里面的使用,先上代码。

<script>
    var aCity = { 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林", 23: "黑龙江 ", 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", 41: "河南", 42: "湖北 ", 43: "湖南", 44: "广东", 45: "广西", 46: "海南", 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏 ", 61: "陕西", 62: "甘肃", 63: "青海", 64: "宁夏", 65: "新疆", 71: "台湾", 81: "香港", 82: "澳门", 91: "国外 " }
    var t3 = document.getElementById("<%=TextBox3.ClientID%>");
    function cidInfo(sId) {
    
        var iSum = 0
        var info = ""
        if (!/^\d{17}(\d|X|x)$/.test(sId)) {
            alert('"请输入完整身份证号码!');
            TextBox3.focus();
            
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition by Mark J. Price English | 24 Mar. 2017 | ASIN: B01N8UG78Q | 594 Pages | AZW3 | 23.26 MB Modern Cross-Platform Development About This Book Build modern, cross-platform applications with .NET Core Get up to speed with C#, and up to date with all the latest features of C# 7 Start creating professional web applications with ASP.NET Core Who This Book Is For This book is targeted towards readers who have some prior programming experience or have a science, technology, engineering, or mathematics (STEM) background, and want to gain a solid foundation with C# and to be introduced to the types of applications they could build and will work cross-platform on Windows, Linux, and macOS. What You Will Learn Build cross-platform applications using C# 7 and .NET Core Explore ASP.NET Core and learn how to create professional web applications Improve your application's performance using multitasking Use Entity Framework Core and find out how to build code-first databases Master object-oriented programming with C# to increase code reuse and efficiency Familiarize yourself with cross-device app development using the Universal Windows Platform and XAML Query and manipulate data using LINQ Protect your data by using encryption and hashing In Detail If you want to build powerful cross-platform applications with C# 7 and .NET Core, then this book is for you. First, we'll run you through the basics of C#, as well as object-oriented programming, before taking a quick tour through the latest features of C# 7 such as tuples, pattern matching, out variables, and so on. After quickly taking you through C# and how .NET works, we'll dive into the .NET Standard 1.6 class libraries, covering topics such as performance, monitoring, debugging, serialization and encryption. The final section will demonstrate the major types of application that you can build and deploy cross-device and cross-platform. In this section, we

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值