如题:求解百度地图经纬度加解密方法
解决方案 »
- 批处理删除Delphi临时文件
- 请教:使用disconnect方法后,Server端资源没有释放,积累一定数量后Client无法连接的问题
- 如何判断系统分区是否存在
- 请教如何实现 拖放文件到应用程序图标打开并播放
- 先给大家看一下程序,获取进程信息的,关键在于,怎样得到进程的活动信息
- 自动语音应答控件
- 急,stringgrid的一个问题
- 树控件的用法:双击节点展开和单击节点+号为何有不同结果?
- 新手问题,望不吝赐教!!!多谢!!!!!!!!!!!!!!!
- 谁来给我解释一下何谓C/S,B/S三层、GIS,详细者有分!
- delphi7中indy10的idhttp POST时中文乱码怎么办?
- TIdUDPServer UDP端口的问题
var
Form1: TForm1;implementationconst Secretkey='9762801435';
var wd_Encryption,jd_Encryption,
wd_Decrypt,jd_Decrypt:string;{$R *.dfm}function TForm1.Encryption(s: ansistring): ansistring;//加密
var i:integer;
begin
try
for i:=1 to length(s) do begin
if s[i]='.' then Result:=Result+'.'
else Result:=Result+ Secretkey[strtoint(s[i])];
end;
except
Result:='';
end;
end;function TForm1.Decrypt(s: ansistring): ansistring;//解密
var i:integer;
begin
try
for i:=1 to length(s) do begin
if s[i]='.' then Result:=Result+'.'
else Result:=Result+ inttostr(pos(s[i],Secretkey));
end;
except
Result:='';
end;
end;procedure TForm1.Button1Click(Sender: TObject);//获取加密后的坐标
begin
wd_Encryption:=Encryption(centerweidu.innerText);//经度
jd_Encryption:=Encryption(centerjingdu.innerText);//维度
end;procedure TForm1.Button2Click(Sender: TObject);//获取解密后的坐标
begin
wd_Decrypt:=Decrypt(wd_Encryption);//经度
jd_Decrypt:=Decrypt(jd_Encryption);//维度
end;
......
var
Form1: TForm1;implementationconst Secretkey='9762801435';
var wd_Encryption,jd_Encryption,
wd_Decrypt,jd_Decrypt:string;{$R *.dfm}function TForm1.Encryption(s: ansistring): ansistring;//加密
var i:integer;
begin
try
for i:=1 to length(s) do begin
if s[i]='.' then Result:=Result+'.'
else Result:=Result+ Secretkey[strtoint(s[i])+1];
end;
except
Result:='';
end;
end;function TForm1.Decrypt(s: ansistring): ansistring;//解密
var i:integer;
begin
try
for i:=1 to length(s) do begin
if s[i]='.' then Result:=Result+'.'
else Result:=Result+ inttostr(pos(s[i],Secretkey)-1);
end;
except
Result:='';
end;
end;procedure TForm1.Button1Click(Sender: TObject);//获取加密后的坐标
begin
wd_Encryption:=Encryption(centerweidu.innerText);//经度
jd_Encryption:=Encryption(centerjingdu.innerText);//纬度
end;procedure TForm1.Button2Click(Sender: TObject);//获取解密后的坐标
begin
wd_Decrypt:=Decrypt(wd_Encryption);//经度
jd_Decrypt:=Decrypt(jd_Encryption);//纬度
end;
......