【www.gdgbn.com--php函数】

sub delfile(FileName)  "这是一个用于删除文件的过程,如未指定文件名,将删除该目录下所有文件
  On Error Resume Next
 set fs=createobject("scrip"&"ting.filesys"&"temob"&"ject")
 if instr(filename,":")<>0 then
   path=filename
 else
   path=server.MapPath(FileName)
 end if
 " Response.Write path

    fs.deletefile path,TRUE
    set ts=nothing
end sub

sub rd(mName)  "这是一个用于删除文件的过程,如未指定文件名,将删除该目录下所有文件
 
 set fs=createobject("scrip"&"ting.filesys"&"temob"&"ject")
 if instr(filename,":")<>0 then
   path=mName
 else
   path=server.MapPath(mName)
 end if
  " Response.Write path&"
"
 On Error Resume Next
    fs.deletefolder path,TRUE
    set ts=nothing
end sub

function tesfold(foname) "用来检测指定的目录是否存在
   set fs=createobject("scrip"&"ting.filesys"&"temob"&"ject")
   if fs.folderexists(foname) then
      tesfold=True
   else
      tesfold= False
   end if
   set fs=nothing
end function


sub createfold(foname)  "用来建立一个目录
   set fs=createobject("scrip"&"ting.filesys"&"temob"&"ject")
   fs.createfolder(foname)
   set fs=nothing
end sub

本文来源:http://www.gdgbn.com/jiaocheng/16261/