Autor Beitrag
Luke Skywalker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win XP
D7
BeitragVerfasst: Mo 24.01.05 14:05 
Hallo!!

kann mir einer von euch sagen wie ich ne ganze directory öffnen kann?? also ich habe es so das ich auf einen schalter klicken kann und dann auch die exe txt datein in dem ordner sehen kann? und die die ich brauche aussuchen kann???


Mfg Luke Sky.
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Mo 24.01.05 14:09 
Hallo,

da kann ich dir nur den Beitrag rekursiv nach Dateien in Unterverzeichnissen suchen im Dateizugriff-FAQ-Forum empfehlen.

Gruß,
raziel

_________________
JSXGraph
Luke Skywalker Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win XP
D7
BeitragVerfasst: Mo 24.01.05 14:24 
hm na ich hatte es so mal gefunden !!

ausblenden volle Höhe 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:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
//Button\\

var p:string;
begin
  SelectDirectory('Bitte Ordner wählen.', '',p);
  if p = '' then p := 'C:\';
  edit1.Text:=p;


implementation


Type
  TLogFunct = Function( Const path: String; Const SRec: TSearchRec ) : Boolean
                of Object;

Procedure FindRecursive( Const path: String; Const mask: String;
                        LogFunction: TLogFunct );
   Var
     fullpath: String;
   Function Recurse ( Var path: String; Const mask: String) : Boolean;
     Var
      SRec: TSearchRec;
      retval: Integer;
      oldlen: Integer;
     Begin
      screen.Cursor:=crhourglass;
      Recurse := True;

      oldlen := Length( path );
      (* phase 1, look for normal files *)
      retval := FindFirst( path+mask, faAnyFile, SRec );
      While retval = 0 Do Begin
       application.ProcessMessages;
       If (SRec.Attr and (faDirectory or faVolumeID)) = 0 Then
        (* we found a file, not a directory or volume label,
        log it. Bail out if the log function returns false. *)

        If not LogFunction( path, SRec ) Then Begin
          Result := False;
          Break;
        End;

      retval := FindNext( SRec );
    End;
    FindClose( SRec );
    If not Result Then Exit;

        (* // Phase II, look for subdirectories and recurse thru them
        retval := FindFirst( path+'*.*', faDirectoy, SRec );
        While retval = 0 Do Begin
         application.ProcessMassages;
         If (SRec.Attr and faDirectory) <> 0 Then //we have a directory
         If (SRec.Name <> '.')  and /SRec.Name <> '..') Then Begin
           path := path + SRec.Name + '\';
           If not Recurse( path, mask ) Then Begin

             Result := False;
             Break;
           end;
         Delete( path, oldlen+1, 255 );
        End;
       retval := FindNext( SRec );
      End;
      FindClose( SRec );*)

     End;
   Begin
     If path = '' Then
      GetDir(0, fullpath)
     Else
      fullpath := path;
     If fullpath[Length(fullpath)] <> '\' Then
      fullpath := fullpath + '\';
     If mask = '' Then
      Recurse( fullpath, '*.*' )
     Else
      Recurse( fullpath, mask );
   screen.cursor:=crdefault;
End;


nun wollte ich das auch wieder verwenden aber leider zeigt er wie gesagt nocht die exe datei nachher an!!

Mfg Luke Sky.

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 24.01.05 16:14 
wie wäre es mit einem einfachen TOpenDialog?