- 校验:
var verify = IDCardHelper.TryVerify("610402196903194412", out var error);
verify
等于true
时校验通过,error
为null
;
verify
等于false
时,error
为错误原因;
- 解析:
var idCard = IDCardHelper.Parse("14010319660730424x");
结果示例:
{
"Province":"山西省",
"Prefecture":"太原市",
"County": "北城区",
"Birthday": "1966/7/30 00:00:00",
"Gender": 0
}
民政部网站公开数据:http://www.mca.gov.cn/article/sj/xzqh/