Autor Beitrag
Sauger Chris
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 228

Win XP, Linux SuSE 9.2
Delphi 4,Delphi 7 Ent.
BeitragVerfasst: Mo 29.03.04 18:22 
Hallo ich will ein listbox inhalt verschlüsselt speichern ('./Ver.dat')
und beim start von meinem Programm
den entschlüsselt text in meiner listbox kompo. haben.
Danke

Gruß
Sauger Chris (Delpih7)
tomtom62
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278

WIN 2000, XP prof
D5 prof.
BeitragVerfasst: Mo 29.03.04 18:57 
Hallo,

die Listbox Items sind TStrings. Sieh Dir mal die Hilfe zu TStrings an. Da gibt es auch Methoden zum Laden und Speichern. Das sollte Dich schon mal weiterbringen.

Wenn Du in einen Stream schreibst, dann kannst Du auch einfach ver- bzw. entschlüsseln. Such einfach mal
in www.sourceforge.net nach Lockbox....
DaDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27

Win 2000, Linux
D2005 Prof
BeitragVerfasst: Mo 29.03.04 20:28 
Eine "Schnellschuss"-Lösung für Dein Problem könnte so aussehen:

Besorge und installiere die Blowfish-Comp (BFH) von www.sksoft.de.
Plaziere die Comp mit 2 Buttons und einer Listbox auf einem Formular.
Schreibe folgenden Code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
procedure TForm1.btnSaveClick(Sender: TObject);
var
  SS: TStringStream;
  FS: TFileStream;
begin
  SS := TStringStream.Create(ListBox1.Items.Text);
  FS := TFileStream.Create('.\ver.dat', fmCreate);
  BFH1.Keyword := 'test'; // Dein Passwort
  BFH1.EncryptStream(SS, FS);
  FS.Free;
  SS.Free;
end;

procedure TForm1.btnLoadClick(Sender: TObject);
var
  FS: TFileStream;
  SS: TStringStream;
begin
  FS := TFileStream.Create('.\ver.dat', fmOpenRead);
  SS := TStringStream.Create('');
  BFH1.Keyword := 'test'; // Dein Passwort
  BFH1.DecryptStream(FS, SS);
  ListBox1.Items.Text := SS.DataString;
  SS.Free;
  FS.Free;
end;


Vieleicht hilft Dir dieser Code-Schnipsel weiter...

Gruß
Sven

_________________
Das Denken ist die schwierigste Arbeit für einen Menschen. Deswegen beschäftigen sich ja auch nur so wenige damit...
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 30.03.04 21:52 
Wenn Dir eine einfache Verschlüsselung reicht, dann such mal nach Suche in: Delphi-Forum, Delphi-Library XOR AND VERSCHLÜSSELUNG.
Gruß, jjturbo

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Sauger Chris Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 228

Win XP, Linux SuSE 9.2
Delphi 4,Delphi 7 Ent.
BeitragVerfasst: Di 06.04.04 18:59 
Titel: Danke
Danke

für eure beiträge
das mit bfh kom. hat mich
weiter gebracht

Gruß
Chris(Delphi7)