On Feb 25, 2007, at 02:01 UTC, Lennox Jacob wrote:

> Hello,
> I have a Folder that is named "My Temp Files".
> I also have a pushbutton named "Delete My Temp Files" How do I code
> the pushbutton to delete all files in "My Temp Files" folder? Thanks.

Well, I'm going to assume you can get a FolderItem to your My Temp
Files folder.  Then pass it into a method that looks like this:

Sub DeleteFiles( dir as FolderItem )
  for i As Integer = dir.Count DownTo 1
    Dim f As File = dir.TrueItem(i)
    if f.Directory then DeleteFiles f
    f.Delete
  next
End Sub

This is a recursive implementation, which is not always ideal, but it
sure is easy in cases like this.  It's also light on error-checking...
but hey, it's just sample code; you can't expect us to write your whole
app for you.  :)

Cheers,
- Joe

--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to