asp fso操作类
 代码如下:

<%
'================================================================
'=                    系统版本:1.0                                =
'=                    文件版本:1.0                                =
'=                文本创建日期:2005-10-31                        =
'================================================================
class cls_io
    private filesystemobject

    private sub class_terminate()
        if isobject(filesystemobject) then
            set filesystemobject = nothing
        end if
    end sub

    '//创建filesystemobject对象
    public function init_object()
        on error resume next
        if not isobject(filesystemobject) then
            set filesystemobject = server.createobject("scripting.filesystemobject")
            if err.number <> 0 then
                init_object = false
                err.clear
                exit function
            else
                init_object = true
            end if
        end if
    end function

    public sub deletefile(byval str)
        on error resume next
        call filesystemobject.deletefile(server.mappath("../uploadfile/"&str))
    end sub

    public function isfolder(byval str)
        isfolder = filesystemobject.folderexists(str)
    end function

    
    public function showfolder(byval str)
        dim obj_folder,obj_file
        set obj_folder = filesystemobject.getfolder(server.mappath(str))
        set showfolder = obj_folder.files
        set obj_folder = nothing
    end function

end class
%>
相关文章