pb刪除指定文件夾下所有文件

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

//功  能:清空指定文件夾下所有文件(指定路徑下所有文件)

//參  數:

//              string  as_filepath:指定路徑

//              listbox  lb_file       :下拉組合框

//反回值:無

//書寫人:ljh  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

 

 

 

------------------------------------------------------------------------------------------

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.

發佈了93 篇原創文章 · 獲贊 9 · 訪問量 26萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章