加入收藏 | 设为首页 | 会员中心 | 我要投稿 银川站长网 (https://www.0951zz.com/)- 云通信、基础存储、云上网络、机器学习、视觉智能!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

结合FSO操作和Aspjpeg组件编辑的Class

发布时间:2023-08-12 12:47:43 所属栏目:Asp教程 来源:
导读:程序代码:<%&#39;***************************** CDS系统 FSO操作类 Beta1 *****************************&#39;调用方法: Set Obj=New FSOControl&#39;所有路径必须为绝对路径,请采用Server.MapPath方法转换路径后再

程序代码:

<%

'***************************** CDS系统 FSO操作类 Beta1 *****************************

'调用方法: Set Obj=New FSOControl

'所有路径必须为绝对路径,请采用Server.MapPath方法转换路径后再定义变量

'------ FileRun ---------------------------------------

'

'必选参数:

'FilePath ------ 处理文件路径

'

'可选参数:

'FileAllowType ------ 处理文件允许的类型,定义方法例: gif|jpg|png|txt

'FileNewDir ------ 文件处理后保存到的目录

'FileNewName ------ 新文件名前缀,请不要添加后缀, 例: sample.txt 则为 sample

'CoverPr ------ 是否覆盖已有的文件 0为否 1为是 默认为1

'deletePr ------ 是否删除原文件 0为否 1为是 默认为1

'---------------------------------------------------------

'------ UpDir(path) 取path的父目录

'path可为文件,也可为目录

'------ GetPrefixName(path) 取文件名前缀

'path必须为文件,可为完整路径,也可是单独文件名

'------ GetFileName(path) 取文件名

'path必须为文件,可为完整路径,也可是单独文件名

'------ GetExtensionName(path) 取文件名后缀,不包含"."

'path必须为文件,可为完整路径,也可是单独文件名

'------ FileIs(path) path是否为一文件

'如为,返回 true 否则返回 false

'------ FolderCreat(Path)

'------ Folderdelete(Path,FileIF)

'------ FileCopy(Path_From,Path_To,CoverIF)

'------ FileMove(Path_From,Path_To,CoverIF)

'------ Filedelete(Path)

'------ Filerename(OldName,NewName,CoverIf)

Class FSOControl

Dim FSO

Private File_Path,File_AllowType,File_NewFolder_Path,File_NewName,File_CoverIf,File_deleteIf

Public Property Let FilePath(StrType)

File_Path=StrType

End Property

Public Property Let FileAllowType(StrType)

File_AllowType=StrType

End Property

Public Property Let FileNewDir(StrType)

File_NewFolder_Path=StrType

End Property

Public Property Let FileNewName(StrType)

File_NewName=StrType

End Property

Public Property Let CoverPr(LngSize)

If isNumeric(LngSize) then

File_CoverIf=Clng(LngSize)

End If

End Property

Public Property Let deletePr(LngSize)

If isNumeric(LngSize) then

File_deleteIf=Clng(LngSize)

End If

End Property

Private Sub Class_Initialize()

Set FSO=createObject("Scripting.FileSystemObject") 

(编辑:银川站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章