delphi 15位身份证号码转18位身份证号码


本文整理自网络,侵删。

 //15位身份证转18位身份证 
//仅供参考 
Function GetIDCard(AiIDCard : String) : String; 
Const 
IDCardGene : Array[1..18] Of Integer = (7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1); 
IDCardParity : Array[0..10] Of Char = ('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'); 
ValidLen = 15; 
Var 
sIDCard : String; 
i, s : Integer; 
Begin 
Result := ''; 
s := 0; 
sIDCard := Trim(AiIDCard); 
If(Length(sIDCard)=ValidLen)Then 
Begin 
Insert('19', sIDCard, 7); 
For i := 1 To ValidLen+2 Do 
Begin 
s := s + StrToInt(sIDCard[i]) * IDCardGene[i]; 
End; 
Result := sIDCard + IDCardParity[(s Mod 11)] 
End; 
End; 

相关阅读 >>

Delphi winapi: messagebeep - 播放一个系统声音

Delphi让tedit控件的内容居中或右对齐,限制位数,仅允许输入数字

Delphi 在tunimemo中复制和粘贴选定的文本

Delphi 将base64字符串转化为jpeg图片

Delphi 如何在webservice中获取客户端的ip地址

Delphi 判断特定字符是为单字节还是双字节

Delphi xe5在zip文件中添加某个txt文件并写入文字

Delphi版的base64转换函数(修改版)

Delphi 提升进程权限

Delphi 多种方法查找窗口句柄

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...