访问 http://www.qqread.com/delphi/w020831040.html
While I $#@60;$#@62; 0 do
begin
Result[I] := "0";
I := Pos(" ", Result);
end;
end;
function HexToStr(AStr: string): string;
var
I : Integer;
CharValue: Word;
begin
Result := "";
For I := 1 to Trunc(Length(Astr)/2) do
begin
Result := Result + " ";
CharValue := TransChar(AStr[2*I-1])*16 + TransChar(AStr[2*I]);
Result[I] := Char(CharValue);
end;
end;
function Encrypt(const S: String; Key: Word): String;
var
I : Integer;
begin
Result := S;
for I := 1 to Length(S) do
begin
Result[I] := char(byte(S[I]) xor (Key shr 8));
Key := (byte(Result[I]) + Key) * C1 + C2;
if Result[I] = Chr(0) then
Result[I] := S[I];
end;
Result := StrToHex(Result);
end;
更多内容请看加密与解密技术、常用软件加密宝典专题,或进入讨论组讨论。
I := Pos(" ", Result);
While I $#@60;$#@62; 0 do
begin
Result[I] := "0";
I := Pos(" ", Result);
end;
end;
function HexToStr(AStr: string): string;
var
I : Integer;
CharValue: Word;
begin
Result := "";
For I := 1 to Trunc(Length(Astr)/2) do
begin
Result := Result + " ";
CharValue := TransChar(AStr[2*I-1])*16 + TransChar(AStr[2*I]);
Result[I] := Char(CharValue);
end;
end;
function Encrypt(const S: String; Key: Word): String;
var
I : Integer;
begin
Result := S;
for I := 1 to Length(S) do
begin
Result[I] := char(byte(S[I]) xor (Key shr 8));
Key := (byte(Result[I]) + Key) * C1 + C2;
if Result[I] = Chr(0) then
Result[I] := S[I];
end;
Result := StrToHex(Result);
end;
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- 熊猫烧香核心源码(Delphi模仿版-仅供学习 (11349次浏览)
- 用Delphi开发视频聊天软件 (4953次浏览)
- Delphi控制Excel自动生成报表 (4001次浏览)
- 动态语言崛起 Delphi For PHP能否挽救Borla (2976次浏览)
- Delphi 中串口通讯的实现 (2889次浏览)
- 用Delphi + DirectX开发简单RPG游戏 (2551次浏览)
- 用Delphi和Web Services开发短信应用程序 (2043次浏览)
- 使用TCP/IP协议实现聊天程序 (1827次浏览)
- 用DELPHI实现文件加密压缩 (1721次浏览)
- 利用Delphi编程控制摄像头 (1391次浏览)



