Asp fso operation class

Source: Internet
Author: User

CopyCode The Code is as follows: <%
'================================================ ======================================
'= System Version: 1.0 =
'= File version: 1.0 =
'= Text creation date: 2005-10-31 =
'================================================ ======================================
Class cls_io
Private FileSystemObject

Private sub class_terminate ()
If isobject (FileSystemObject) then
Set FileSystemObject = nothing
End if
End sub

'// Create a FileSystemObject object
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
%>

Related Article

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.