C
crpp0602
Unregistered / Unconfirmed
GUEST, unregistred user!
如何将所输入的字符串转成BYTE类型的,如下我写的代码,好象有点问题,
代码如下:
pStr := StrAlloc(Length(FInputString) + 1);
try {protect dyanmic memory allocation}
StrPCopy(pStr, FInputString);
{$ENDIF}
{$IFDEF BP7}
GetMem(pStr, Length(FInputString));
Move(FInputString[1],pStr^, Length(FInputString));
{$ENDIF}
FInputLength := Length(FInputString);
FInputArray := Pointer(pStr);
{Check Length!!!!}
Move(FInputArray^, FBuffer, FInputLength);
Encipher_Bytes;
{$IFDEF DELPHI}
finally
StrDispose(pStr);
end;
{$ENDIF}
{$IFDEF BP7}
FreeMem(pStr,Length(FInputString));
有哪个高手能指点一下:
代码如下:
pStr := StrAlloc(Length(FInputString) + 1);
try {protect dyanmic memory allocation}
StrPCopy(pStr, FInputString);
{$ENDIF}
{$IFDEF BP7}
GetMem(pStr, Length(FInputString));
Move(FInputString[1],pStr^, Length(FInputString));
{$ENDIF}
FInputLength := Length(FInputString);
FInputArray := Pointer(pStr);
{Check Length!!!!}
Move(FInputArray^, FBuffer, FInputLength);
Encipher_Bytes;
{$IFDEF DELPHI}
finally
StrDispose(pStr);
end;
{$ENDIF}
{$IFDEF BP7}
FreeMem(pStr,Length(FInputString));
有哪个高手能指点一下: