当前位置:编程学习 > C#/ASP.NET >>

最简单的C# 验证/升位公民身份号码/身份证号码

1 using System;
2  using System.Text.RegularExpressions;
3
4  namespace Hongcing
5 {
6     /// <summary>
7     /// 验证公民身份号码/身份证号码升位
8     /// </summary>
9     public static class VerifyIdCard
10     {
11         static readonly int[] iW = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };
12         //static readonly char[] szVerCode ={ 1, 0, X, 9, 8, 7, 6, 5, 4, 3, 2 };
13         static readonly string szVerCode = "10X98765432";
14
15         /// <summary>
16         /// 获取校验码
17         /// </summary>
18         /// <param name="id">17位字符串</param>
19         /// <returns>返回的校验码</returns>
20         private static char GetVerifyChar(string id)
21         {

补充:软件开发 , C# ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,