asp快速删除文件夹和文件
写了个asp删除文件和文件夹的函数,可以把它写到公共文件里,然后用的时候是 call fileDel("file",1) 其中的file是文件的路径,可以是绝对目录也可以是相对目录,1为删除目录,如果不是1则删除的为文件
function fileDel(path,lei)'path目录,lei如果是1则删除目录,否则为文件
path=Server.MapPath(path)
Set fso = CreateObject("Scripting.FileSystemObject")
if lei=1 then
If fso.FolderExists(path) Then
Set f = fso.GetFolder(path)
f.delete()
Set f = Nothing
fileDel=true
else
fileDel=false
End If
else
If fso.FileExists(path) Then
Set f = fso.GetFile(path)
f.delete()
Set f = Nothing
fileDel=true
else
fileDel=false
End If
end if
end function
本文链接:https://xuexb.com/post/98.html
-- EOF --
提醒: 本文最后更新于 3189 天前,文中所描述的信息可能已发生改变,请谨慎使用。
Comments
注:如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理。