最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp生成目录与无限生成多级目录创建
时间:2022-06-29 13:49:06 编辑:袖梨 来源:一聚教程网
sub efolder(foldername)
dim fso
set fso=server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(foldername)) then
set fso=nothing
exit sub
else
fso.createfolder(server.mappath(foldername))
end if
set fso=nothing
end sub
'===================================================================
sub arrayfolder(path,sep)
dim arraypath,epath,newpath
arraypath = split(path,sep)
newpath=""
for each epath in arraypath
newpath=newpath&epath&"/"
newpath = replace(newpath,"//","/")
efolder newpath
next
end subarrayfolder "1/2/3","/"
'生成多级目录
'建立目录的程序,如果有多级目录,则一级一级的创建
function createdir(byval localpath)
on error resume next
localpath = replace(localpath,"","/")
set fileobject = server.createobject("scripting.filesystemobject")
patharr = split(localpath,"/")
path_level = ubound(patharr)
for i = 0 to path_level
if i=0 then pathtmp=patharr(0) & "/" else pathtmp = pathtmp & patharr(i) & "/"
cpath = left(pathtmp,len(pathtmp)-1)
if not fileobject.folderexists(cpath) then fileobject.createfolder cpath
next
set fileobject = nothing
if err.number <> 0 then
createdir = false
err.clear
else
createdir = true
end if
end function%>
相关文章
- 金铲铲之战s14血魔流皇子阵容攻略 07-02
- PS如何给高光区上色 PS给高光区上色的方法教程 07-02
- 魔兽世界可怖的惊惧之翼坐骑怎么获得 07-02
- Bitcoin Virtual Gold(BVG币)量化交易 07-02
- 掌门下山伙伴推荐及阵容搭配推荐 07-02
- 鸣潮2.3赞妮培养材料大全 07-02