Autor Beitrag
daywalker0086
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243


Delphi 2005 Architect
BeitragVerfasst: Fr 29.04.05 18:55 
Hallo an alle Profis,
habe ein Problem :? . Möchte einen Ordner überwachen lassen, das heißt wenn ne Datei reingeschrieben wird, soll das Überwachungsprogramm dann eben ne Procedure ausführen.
Geht das irgendwie? hab da keinen Ansatz.
Im Vorraus danke
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Fr 29.04.05 19:30 
Du musst dann die ganze Zeit die Anzahl der Dateien im Ordner und deren Größe überwachen. ;)
P4PE2
ontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 26

Win Server 03, Win XP prof
D6 Pers
BeitragVerfasst: Fr 29.04.05 19:33 
user profile iconWeBsPaCe hat folgendes geschrieben:
Du musst dann die ganze Zeit die Anzahl der Dateien im Ordner und deren Größe überwachen. ;)


Das bringt weiter...

//Edit Ja, dieser Beitrag bringt dich auch net weiter :wink:
Hab leider auch keine Ahnung... :D
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Fr 29.04.05 19:38 
Zitat:
Du musst dann die ganze Zeit die Anzahl der Dateien im Ordner und deren Größe überwachen. ;)

Das bringt weiter...


Tja, da bist du auchnet viel besser, oder?

@daywalker0086: Wenn du weist, wie man alle Dateien in einem Ordner anzeigen lassen kann ist das kein Prpblem. Hast de schon mal hier im Forum geschaut? Ich bin mir sicher das sich da was findet und geh jetzt selber mal auf die Suche. Vieleicht irgendwas mit findfirst und findnext...

//edit: www.delphi-forum.de/...ight=datein+anzeigen

Moderiert von user profile iconChristian S.: Beiträge zusammengefasst
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Fr 29.04.05 19:40 
user profile icondaywalker0086 hat folgendes geschrieben:
Hallo an alle Profis,
habe ein Problem :? . Möchte einen Ordner überwachen lassen, das heißt wenn ne Datei reingeschrieben wird, soll das Überwachungsprogramm dann eben ne Procedure ausführen.
Geht das irgendwie? hab da keinen Ansatz.
Im Vorraus danke
Das ist nicht trivial. Schau mal hier nach filemon, dass macht sowas: www.sysinternals.com/. Aber das ist wirklich nur was für erfahrene Programmierer wie du hoffentlich einer bist!

Gruß Hape!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Fr 29.04.05 19:41 
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 29.04.05 20:14 
Viel besser sollte glaube folgender Link zu den Schweizern helfen:
www.swissdelphicente...owtopic=9394&hl=

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
daywalker0086 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243


Delphi 2005 Architect
BeitragVerfasst: Fr 29.04.05 20:21 
Titel: mnhm
Hab den Code von dem Link mal ausprobiert, damit er erstmal die daten anzeigt. es kommt aber bei der Zeile:
Laufwerk:=DriveComboBox1.Drive; dann immer die Meldung : Undeclared identifier: 'Drive'
wie kann ich das Prob. beseitigen?

Und wie hab ich dann vorzugehen mit dem sog. Überwachen?
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 30.04.05 06:46 
Vielleicht fehlr was in der Uses-Klausel...

Aber, nimm mal meienen Link ganz oben, ich denke dass der dir weiterhilft.
Der Link von BenBE funzt bei mir net...
daywalker0086 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243


Delphi 2005 Architect
BeitragVerfasst: Sa 30.04.05 09:10 
Titel: mhm
Den hab ich doch benutzt, da steht ja der Code.
Wissst ihr was den in die uses Clausel noch reinkommt , falls es daran liegt?

Das ist doch nicht irgend ne spazielle combobox oder hab einfach die normale Combovox genommen.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 30.04.05 09:45 
Das ist ne DriveCombobox, die hast irgendwo sicherlich auch. Einfach mal gucken.
Die DCombob zeigt alle Laufwerke an.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 30.04.05 09:48 
Bei D3 ist die in der Spaltze Win3.1
Bei D2005 auch.
daywalker0086 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243


Delphi 2005 Architect
BeitragVerfasst: Sa 30.04.05 10:02 
Titel: OK
Ich bin auch ein drops.
Naja jetzt funktioniert das erstmal, nu was bringt mir das jetzt bei meinem Problem mit der überwachung?

Nachtrag:
Hab da auch das Problem das die erste Datei nicht angezeigt wird, ab er wenn ich dann den Source kopiere wie es richtig gehen sollte, dann hängt sich das Programm auf und Delphi gleich mit. <-- Also bezogon auf den Link oben
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 30.04.05 10:45 
naja, jetzt kannst'de die Datein zb in einem Memo auflisten, und alle paar sec überprüfen. falls sich im Memo was verändert kannst'de Alarm schlagen.

Oder du hast noch ein zweites Memo indem alle erlaubten Dateien stehen. Dann üpberprüfst du immer ob eine Dat in Memo1 steht die nicht im 2 steht (würd ich mit indexof() machen.
daywalker0086 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243


Delphi 2005 Architect
BeitragVerfasst: Sa 30.04.05 11:10 
Titel: Ok
Das is natürlich die Idee, ich probiers aus.
Noch ne frage wie schreib ich das
if memo.(was kommt hier hin).... then
Code
else
Meldung
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 30.04.05 11:13 
Meinst du indexof?

if Memo1.lines.indexof('Datei.txt') then
ShowMessage('Alles OK')
else
ShowMessage('Nicht in de5 Liste, WARNUNG');
daywalker0086 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243


Delphi 2005 Architect
BeitragVerfasst: Sa 30.04.05 11:23 
Titel: ja
So meinte ich das, nur dass ich kein Memofeld habe, sondern eine Listbox und da fuktioniert dein Code irgendwie nich

Nachtrag:
habs hinbekommen
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
 if ListBox1.items.indexof('02.05.05.pdf')=-1  then

   ShowMessage('Alles OK')
else
ShowMessage('Nicht in de5 Liste, WARNUNG');


Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.


Zuletzt bearbeitet von daywalker0086 am Sa 30.04.05 11:35, insgesamt 1-mal bearbeitet
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Sa 30.04.05 11:26 
es gibt glaub ich auch eine komponente von Jedi! :wink:

_________________
Aus dem Urlaub zurück!
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Sa 30.04.05 11:28 
user profile iconScorpionKing hat folgendes geschrieben:
es gibt glaub ich auch eine komponente von Jedi! :wink:

dann such sie mal raus, der link von BenBE war nicht gerade hilfreich

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
daywalker0086 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 243


Delphi 2005 Architect
BeitragVerfasst: Sa 30.04.05 11:39 
Titel: supi
Siehe Mein vorletzten Beitrag.

ABER OHNE EUCH HÄT ICHS NICH HINBEKOMMEN 8) :idea:

Nachtrag: Es funzt nich so richtig der sagt auch alles klar, wenn die Datei nich da is, an was kann das liegen?

Nachtrag: Es läuft

Nachtrag: Hab jetzt nur noch ein Problem:
Er zeigt die erste Datei immernoch nicht an wie in dem anderen Artikel beschrieben, aber der Code der da beschrieben ist mit dem es geht, funktioniert bei mir nicht, da hängt sich da Prog. auf.
Wie kann ichs nun machen, dass alle Dateien angezeigt werden ?

Poste mal den Code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
FindFirst(dir+'*.*',faAnyFile,tr);
    while FindNext(tr)=0 do
        begin
        if not (tr.Name='..') then
        begin
         if (tr.Attr and faDirectory > 0) then
         FindAllFiles(dir+tr.Name+'\',output,count) else
            begin
              inc(count);
              output.Add(dir+tr.Name);
            end;
        end;
    end;


Moderiert von user profile iconGausi: Code- durch Delphi-Tags ersetzt und ein paar Absätze entfernt