微慑信息网

delphi进制转换-卡号生成

PF卡号转换:

procedure TForm1.Button2Click(Sender: TObject);
var
a,b,c,d,e,x:string;
 Info2:Change;
i:integer;
r1,r2,r3,r4,r5:string;

begin

if length(edit1.Text)=10 then

 begin
//x:=length(edit1.text) ;
a:=copy(edit1.Text,9,2);
b:=copy(edit1.Text,7,2);
c:=copy(edit1.Text,5,2);
d:=copy(edit1.Text,3,2);
e:=copy(edit1.Text,1,2);
edit3.text:=e+d+c+b+a;
  if  edit3.text = edit1.Text then
    label3.Caption:='TRUE'
  else
    begin
      label3.Caption:='ERROR';
    end;

 //////////////////
 r1 := info2.HexToDex(a) ;
 r2 := info2.HexToDex(b) ;
 r3 := info2.HexToDex(c) ;
 r4 := info2.HexToDex(d) ;
 r5 := info2.HexToDex(e) ;
 edit4.Text:=r1+'+'+r2+'×256'+'+'+r3+'×256×256'+'+'+r4+'×256×256×256'+'+'+r5+'×256×256×256×256';

 //showmessage( floattostr ( strtofloat(r1)+ strtofloat(r2)*256+strtofloat(r3)*256*256 +strtofloat(r4)*256*256*256 +strtofloat(r5)*256*256*256*256  ) );
 x:=  floattostr ( strtofloat(r1)+ strtofloat(r2)*256+strtofloat(r3)*256*256 +strtofloat(r4)*256*256*256 +strtofloat(r5)*256*256*256*256  ) ;
 for i:=length(x) to 14 do
  begin
  x:='0'+x;
  end;
  edit2.text:='8'+x 

end
 else

 begin
     showmessage('卡号输入错误,请输入10位卡号!')
 end;


end;

 

赞(0) 打赏
转载请附本站链接,未经允许不得转载,,谢谢:微慑信息网-VulSee.com » delphi进制转换-卡号生成

评论 抢沙发

微慑信息网 专注工匠精神

微慑信息网-VulSee.com-关注前沿安全态势,聚合网络安全漏洞信息,分享安全文档案例

访问我们联系我们

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册