私は次のコードを持っています:
user_s.username := EnDecrypt(Edit_username.Text);
関数は次のとおりです。
function EnDeCrypt(const Value : String) : String;
var
CharIndex : integer;
begin
Result := Value;
for CharIndex := 1 to Length(Value) do
Result[CharIndex] := chr(not(ord(Value[CharIndex])));
end;
変数のタイプは次のとおりです。
TUser = record
access: char;
username: string[25];
password: string[25];
end;
Delphi 2007では機能しますが、DelphiXE2では失敗します。不思議なことに、123456789の場合、パスワードは適切に暗号化/復号化されます。この問題は、Unicodeとshortstringの使用に関連している必要があります。DelphiXE2でも機能させる方法があるといいのですが。