.. sollte ungefähr so gehen..
Delphi-Quellcode:
procedure loadgrid(StringGrid: TStringGrid;
const FileName: TFileName);
var
csv : TStringList;
i : Integer;
mStream: TMemoryStream
begin
mStream := TMemoryStream.create;
decodeFile(fileName,mStream);
mStream.Posistion := 0;
csv := TStringList.create;
csv.loadfromStream(mStream);
mStream.free;
stringGrid.rowCount :=
csv.count ;
for i:=0
to csv.count -1
do
begin
clear(
CSV[i]);
StringGrid.Rows[i].Delimiter:='
;';
StringGrid.Rows[i].DelimitedText:=
csv[i];
end;
csv.free;
end;
Delphi-Quellcode:
procedure decodeFile(fileName:TFileName;mStream:TMemoryStream);
var
x: TRCxContext;
begin
mStream.loadfromFile(fileName);
RCxInit(x,'Passwort');
RCxdeCode(x,mStream,mStream.size); // entschlüsseln
RcxDone(x);
end;
procedure encodeFile(fileName:TFileName;mStream:TMemoryStream);
var
x: TRCxContext;
begin
RCxInit(x,'Passwort');
RCxenCode(x,mStream,mStream.size); // verschlüsseln
RcxDone(x);
mStream.Position:=0;
mStream.saveToFile(fileName);
end;
.. ist allerdings ungetestet
Grüße
Klaus