asp利用fso实现文件的移动
function movefiles(sFolder,dFolder)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sFolder)) and fso.folderexists(server.mappath(dFolder)) then
fso.copyfolder server.mappath(sFolder),server.mappath(dFolder)
movefiles = true
else
movefiles = false
set fso = nothing
call alertbox("系统没有找到指定的路径[" & sFolder & "]!",2)
end if
set fso = nothing
end function
asp修改文件夹名称
function renamefolder(sFolder,dFolder)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sFolder)) then
fso.movefolder server.mappath(sFolder),server.mappath(dFolder)
renamefolder = true
else
renamefolder = false
set fso = nothing
call alertbox("系统没有找到指定的路径[" & sFolder & "]!",2)
end if
set fso = nothing
end function
asp检查文件夹是否存在
function checkfolder(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sPATH)) then
checkfolder = true
else
checkfolder = false
end if
set fso = nothing
end function
asp检查文件是否存在
function checkfile(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.fileexists(server.mappath(sPATH)) then
checkfile = true
else
checkfile = false
end if
set fso = nothing
end function
asp创建文件夹
function createdir(sPATH)
dim fso,pathArr,i,path_Level,pathTmp,cPATH
on error resume next
sPATH = replace(sPATH,"\","/")
set fso = server.createobject("scripting.filesystemobject")
pathArr = split(sPATH,"/")
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 fso.folderexists(cPATH) then fso.createfolder(cPATH)
next
set fso = nothing
if err.number <> 0 then
err.clear
createdir = false
else
createdir = true
end if
end function
删除文件夹,这里是删除系统中栏目的文件夹
function delclassfolder(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sPATH)) then
fso.deletefolder(server.mappath(sPATH))
end if
set fso = nothing
end function
删除新闻内容文件
function delnewsfile(sPATH,filename)
on error resume next
dim fso,tempArr,cPATH,ePATH,i:i = 0
set fso = server.createobject("scripting.filesystemobject")
sPATH = sPATH & filename & site_extname
if fso.fileexists(server.mappath(sPATH)) then
fso.deletefile(server.mappath(sPATH))
while(i <> -1)
i = i + 1
ePATH = replace(sPATH,filename & ".",filename & "_" & i + 1 & ".")
if fso.fileexists(server.mappath(ePATH)) then
fso.deletefile(server.mappath(ePATH))
else
i = -1
end if
wend
end if
end function
function movefiles(sFolder,dFolder)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sFolder)) and fso.folderexists(server.mappath(dFolder)) then
fso.copyfolder server.mappath(sFolder),server.mappath(dFolder)
movefiles = true
else
movefiles = false
set fso = nothing
call alertbox("系统没有找到指定的路径[" & sFolder & "]!",2)
end if
set fso = nothing
end function
asp修改文件夹名称
function renamefolder(sFolder,dFolder)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sFolder)) then
fso.movefolder server.mappath(sFolder),server.mappath(dFolder)
renamefolder = true
else
renamefolder = false
set fso = nothing
call alertbox("系统没有找到指定的路径[" & sFolder & "]!",2)
end if
set fso = nothing
end function
asp检查文件夹是否存在
function checkfolder(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sPATH)) then
checkfolder = true
else
checkfolder = false
end if
set fso = nothing
end function
asp检查文件是否存在
function checkfile(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.fileexists(server.mappath(sPATH)) then
checkfile = true
else
checkfile = false
end if
set fso = nothing
end function
asp创建文件夹
function createdir(sPATH)
dim fso,pathArr,i,path_Level,pathTmp,cPATH
on error resume next
sPATH = replace(sPATH,"\","/")
set fso = server.createobject("scripting.filesystemobject")
pathArr = split(sPATH,"/")
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 fso.folderexists(cPATH) then fso.createfolder(cPATH)
next
set fso = nothing
if err.number <> 0 then
err.clear
createdir = false
else
createdir = true
end if
end function
删除文件夹,这里是删除系统中栏目的文件夹
function delclassfolder(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sPATH)) then
fso.deletefolder(server.mappath(sPATH))
end if
set fso = nothing
end function
删除新闻内容文件
function delnewsfile(sPATH,filename)
on error resume next
dim fso,tempArr,cPATH,ePATH,i:i = 0
set fso = server.createobject("scripting.filesystemobject")
sPATH = sPATH & filename & site_extname
if fso.fileexists(server.mappath(sPATH)) then
fso.deletefile(server.mappath(sPATH))
while(i <> -1)
i = i + 1
ePATH = replace(sPATH,filename & ".",filename & "_" & i + 1 & ".")
if fso.fileexists(server.mappath(ePATH)) then
fso.deletefile(server.mappath(ePATH))
else
i = -1
end if
wend
end if
end function
标签:
asp,文件,文件夹,操作
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“asp下利用fso实现文件夹或文件移动改名等操作函数”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。