# 身份证号码解释器,ASP.NET实现 **Repository Path**: atalent/identity_card_interpreter ## Basic Information - **Project Name**: 身份证号码解释器,ASP.NET实现 - **Description**: 根据身份证号的规则,尽可能的解析出所有能解释的信息 - **Primary Language**: C# - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2018-07-12 - **Last Updated**: 2023-06-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 身份证号解释器 1-6 地区 7-14 生日 15-16 派出所编号 17 性别 18 校验码 校验码计算方法: ```C# public static string GetVerify(string number) { int[] values = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 }; int sum = 0; for (int index = 0; index < 17; index++) sum += int.Parse(number[index].ToString()) * values[index]; switch (sum % 11) { case 0: return "1"; case 1: return "0"; case 2: return "X"; case 3: return "9"; case 4: return "8"; case 5: return "7"; case 6: return "6"; case 7: return "5"; case 8: return "4"; case 9: return "3"; case 10: return "2"; default: return "ERROR"; } } ```