Pb: delete all objects in a specified folder

Source: Internet
Author: User

//-----------------------------------------------------------------

// Function: Clear all files in the specified folder (all files in the specified path)

// Parameters:

// String as_filepath: Specifies the path

// ListBox lb_file: drop-down combo box

// Reverse return value: None

// Written by: lw.2011-05-24

//-----------------------------------------------------------------

 

Long I

Lb_file.dirlist (as_filepath + "*. *", 0)
If lb_file.totalitems ()> 0 then
For I = 1 to lb_file.totalitems ()
Filedelete (as_filepath + lb_file.text (I ))
Next
End if

 

 

 

Bytes ------------------------------------------------------------------------------------------

Listboxname. DirList (filespec, filetype {, statictext })

 

Argument Description

----------------------------------------------
Listboxname The name of the ListBox control you want to populate

Filespec A string whose value is the file pattern. This is usually a mask (for example, *. INI or

*. TXT). If you include a path, it becomes the current drive and directory

Filetype An unsigned integer representing one or more types of files you want to list in the ListBox.

Types are:

0 -- Read/write files

1 -- read-only files

2 -- hidden files

4 -- system files

16 -- subdirectories

32 -- Archive (modified) files

16384 -- Drives

32768 -- Exclude read/wirte files from the list.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.