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 {