Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 07.10.05 14:52 
Also ich verhindere mit nem Filestream zur Laufzeit dass man auf die Passwortdatei zugreifen kann:
ausblenden Delphi-Quelltext
1:
lock_pw_file:=tfilestream.Create('PW-PFAD',fmshareexclusive);					


Und dann bei onclose will ich die kennwortliste dort reinschreiben, nehme aber vorher den Filestream raus:

ausblenden Delphi-Quelltext
1:
2:
lock_pw_file.free;
kennwort.SaveToFile('PW-PFAD');


Aber ich bekomm immer:

---------------------------
Benachrichtigung über Debugger-Exception
---------------------------
Im Projekt transmitter.exe ist eine Exception der Klasse EFCreateError aufgetreten. Meldung: 'XXXX" kann nicht erstellt werden. Zugriff verweigert'. Prozess wurde angehalten. Mit Einzelne Anweisung oder Start fortsetzen.
---------------------------
OK Hilfe
---------------------------

Das XXXX habe ich statt des PFades eingefügt

Was ich nicht verstehe warum die DAtei gelockt ist obwohl der Filestream 'gefreet' wurde. :gruebel:

Koller

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: Fr 07.10.05 16:27 
Hallo,

villeicht ist es nur ein Tempoproblem. Mach doch mal ein sleep(5000) zwischen free und savetofile und probiere das dann.

Gruss Horst
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 08.10.05 04:43 
Titel: e
Da tut sich auch nix anderes.

Hab jetzt mal geschrieben:

ausblenden Delphi-Quelltext
1:
2:
3:
//den Filestream ausm Speicher werfen
lock_pw_file.Free;
lock_pw_file:=tfilestream.create('XX',fmsharedenyread);


Aber wieder kommt dieser blöde EFCREATEERROR. :bawling:
Ich bin absolut ratlos. Ich habe die PW datei gelockt, damit man sie nicht verändern kann. Ich dachte immer, wenn man den Filestream ausm Speicher wirft dann ist alles wie vorher. Anscheinend isz es ja nicht so.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 08.10.05 10:48 
Titel: s
Ach mensch, :autsch:

Ich habe vergessen, den Schreibschutz der DAtei im Quellcode zu entfernen. Dann ist logisch, warum Delphi dort nicht schreiben konnte

:autsch:

Moderiert von user profile iconraziel: 50(!) :autsch: entfernt

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot