谁能告诉我这是为什么?想说delphi的BUG,不知会不会给捧打呀!·!#!·#!·#
procedure TForm3.btnQueryClick(Sender: TObject);
var
szDecryptString,szTQueryString: string;
temp:Integer;
begin
szTQueryString := 'select SoftWare_ID,name from Software';
Form1.adoquery2.SQL.Clear;
Form1.adoquery2.SQL.Add(szTQueryString);
Form1.adoquery2.Open;
szDecryptString:=Form1.adoquery2.Fields[1].AsString;
// szDecryptString:=Form1.Decrypt(szDecryptString,true);//A句
temp:=Form1.adoquery2.Fields[0].AsInteger;///如果把上一句(A句起用。就会出现
// Access violaiton At Address 0xXXX in module. 错误.
exit;
end;
/////////////////////////////////////////////
function TForm1.Encrypt(Src: string; bMode: boolean): string;
var
hDLl: THandle;
myDecrytFiled: Decryt;
ucInData: array[1..32] of UCHAR;
ucOutData: array[1..32] of UCHAR;
i, inLen, outLen: Integer;
szReult, Temp: string;
begin
inLen := Length(Src);
if bMode = true then
begin
inLen := trunc(inLen / 2);
for i := 1 to inLen do
begin
Temp := MidStr(Src, i * 2 - 1, 2);
ucInData[i] := strtoint('$' + Temp);
end;
end
else
CopyMemory(@ucInData[1], @Src[1], inLen);
for i:=inLen+1 to 31 do
ucInData[i]:=0;
for i:=1 to 32 do
ucOutData[i]:=0;
outLen := trunc((InLen + 7) / 8) * 8;
anblue(@ucOutData,@ucInData,inLen,bMode);///这个调用一个VC的DLL。
Result := '';
for i := 1 to OutLen do
case bMode of
false: Result := Result + inttohex(ucOutData[i], 2);
true: Result := Result + chr(ucOutData[i]);
end;
end;
谁能解释这是为什么?