Results 1 to 6 of 6

Thread: Recurse Folder [RESOLVED]

  1. #1

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    Recurse Folder [RESOLVED]

    Can you help me with a problem solver in Delphi please

    Im trying to delete files from a folder (in my case the IE temp files). I know how to delete all files from a FileListbox, but how do you do it without this? I can use:

    Code:
    procedure TForm1.Button1Click(Sender: TObject);
    var
      i: Integer;
    begin
      for i:=0 to FileListBox1.Items.Count-1 do
        DeleteFile(FileListBox1.Items[i]);
      FileListBox1.Update;
    end;
    But thats not what i want, i just want to clean the IE temp crap

    Thanks
    Last edited by Madboy; May 26th, 2005 at 05:33 AM.

  2. #2
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051

    Re: VisualAd....

    Surely that would depend on how you populate the listbox in the first place.
    Change the code so that instead of adding the file to the listbox you delete it.

    Or is there some function to get the listbox to automatically list files??
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: VisualAd....

    You need to use the Windows API functions:

    http://delphi.about.com/cs/adptips19...ltip1199_2.htm
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    Re: Delphi: Getting all files in a directory.

    Thanks VisualAd, sorry for the non descriptive thread title

    So does this link you posted delete the files in the folder, or just the folder?

    Thanks again mate

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Delphi: Getting all files in a directory.

    A folder can only be deleted when empty, so it first deletes every file and directory inside the file recursivley and then deletes the folder.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    Re: Delphi: Getting all files in a directory.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width